mirror of
https://github.com/Fishwaldo/role_model.git
synced 2025-03-15 19:42:43 +00:00
Ruby 1.8.7 compatibility
This commit is contained in:
parent
39caec8984
commit
9f8c48b69e
1 changed files with 1 additions and 1 deletions
|
@ -65,7 +65,7 @@ module RoleModel
|
|||
#
|
||||
# Defines new methods which call #is?(:role)
|
||||
def method_missing(name, *args, &block)
|
||||
if name =~ /^(?:is_)?(.+)\?$/
|
||||
if name.to_s =~ /^(?:is_)?(.+)\?$/
|
||||
role = $1.to_sym
|
||||
self.class.instance_eval do
|
||||
define_method(name.to_sym) { is? role }
|
||||
|
|
Loading…
Add table
Reference in a new issue