Class: Contraction::DuckType

Inherits:
Object
  • Object
show all
Defined in:
lib/parser/type_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#methodObject (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