Class: Dhallish::Types::Type
- Inherits:
-
Object
- Object
- Dhallish::Types::Type
- Defined in:
- lib/types.rb
Instance Attribute Summary collapse
-
#metadata ⇒ Object
metadata contains information about that type, for example if its a list type.
Instance Method Summary collapse
- #==(otype) ⇒ Object
-
#initialize(metadata = nil) ⇒ Type
constructor
A new instance of Type.
- #to_s ⇒ Object
Constructor Details
#initialize(metadata = nil) ⇒ Type
Returns a new instance of Type.
12 13 14 |
# File 'lib/types.rb', line 12 def initialize(=nil) @metadata = end |
Instance Attribute Details
#metadata ⇒ Object
metadata contains information about that type, for example if its a list type. This is important for the static type checks.
11 12 13 |
# File 'lib/types.rb', line 11 def @metadata end |
Instance Method Details
#==(otype) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/types.rb', line 16 def ==(otype) if !otype.is_a? Type false elsif @metadata != nil && otype. != nil @metadata == otype. else true end end |
#to_s ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/types.rb', line 25 def to_s() if @metadata.nil? or @metadata.is_a? Unresolved "Type" else "Type(#{@metadata.to_s})" end end |