Class: MilkTea::Types::Nullable
- Defined in:
- lib/milk_tea/core/types/types.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
Instance Method Summary collapse
- #children ⇒ Object
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(base) ⇒ Nullable
constructor
A new instance of Nullable.
- #to_s ⇒ Object
Methods inherited from Base
#accept, #bitwise?, #boolean?, #field_c_name, #float?, #integer?, #numeric?, #sendable?, #void?
Constructor Details
#initialize(base) ⇒ Nullable
Returns a new instance of Nullable.
391 392 393 394 395 |
# File 'lib/milk_tea/core/types/types.rb', line 391 def initialize(base) @base = base @hash = [self.class, base].hash freeze end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
389 390 391 |
# File 'lib/milk_tea/core/types/types.rb', line 389 def base @base end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
403 404 405 |
# File 'lib/milk_tea/core/types/types.rb', line 403 def hash @hash end |
Instance Method Details
#children ⇒ Object
409 410 411 |
# File 'lib/milk_tea/core/types/types.rb', line 409 def children [base] end |
#eql?(other) ⇒ Boolean Also known as: ==
397 398 399 |
# File 'lib/milk_tea/core/types/types.rb', line 397 def eql?(other) other.is_a?(Nullable) && other.base == base end |
#to_s ⇒ Object
405 406 407 |
# File 'lib/milk_tea/core/types/types.rb', line 405 def to_s "#{base}?" end |