Class: Contraction::DuckType
- Inherits:
-
Object
- Object
- Contraction::DuckType
- Defined in:
- lib/parser/type_parser.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
- #check(thing) ⇒ Object
-
#initialize(method) ⇒ DuckType
constructor
A new instance of DuckType.
Constructor Details
#initialize(method) ⇒ DuckType
Returns a new instance of DuckType.
57 58 59 |
# File 'lib/parser/type_parser.rb', line 57 def initialize(method) @method = method end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
56 57 58 |
# File 'lib/parser/type_parser.rb', line 56 def method @method end |
Instance Method Details
#check(thing) ⇒ Object
61 62 63 |
# File 'lib/parser/type_parser.rb', line 61 def check(thing) thing.respond_to? method.to_sym end |