Class: Contraction::Parser::Type
- Inherits:
-
Object
- Object
- Contraction::Parser::Type
- Defined in:
- lib/parser/type.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#check(thing) ⇒ Object
Checks weather or not thing is a given type.
-
#initialize(part) ⇒ Type
constructor
A new instance of Type.
Constructor Details
#initialize(part) ⇒ Type
Returns a new instance of Type.
5 6 7 |
# File 'lib/parser/type.rb', line 5 def initialize(part) parse(part) end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/parser/type.rb', line 4 def type @type end |
Instance Method Details
#check(thing) ⇒ Object
Checks weather or not thing is a given type.
10 11 12 13 |
# File 'lib/parser/type.rb', line 10 def check(thing) return true unless type type.check thing end |