Class: AdvAccessor::Checker
- Inherits:
-
Object
- Object
- AdvAccessor::Checker
- Includes:
- FromHash
- Defined in:
- lib/adv_accessor/checker.rb
Instance Attribute Summary collapse
-
#obj ⇒ Object
Returns the value of attribute obj.
Instance Method Summary collapse
Instance Attribute Details
#obj ⇒ Object
Returns the value of attribute obj.
4 5 6 |
# File 'lib/adv_accessor/checker.rb', line 4 def obj @obj end |
Instance Method Details
#match?(o) ⇒ Boolean
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/adv_accessor/checker.rb', line 5 def match?(o) if obj.kind_of?(Proc) !!obj[o] elsif obj.kind_of?(Class) o.kind_of?(obj) elsif obj.kind_of?(Regexp) !!(o =~ obj) else o == obj end end |