Class: Literal::Types::UnitType Private

Inherits:
Object
  • Object
show all
Includes:
Literal::Type
Defined in:
lib/literal/types/unit_type.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

EQUAL_METHOD =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

BasicObject.instance_method(:equal?)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ UnitType

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of UnitType.



9
10
11
12
# File 'lib/literal/types/unit_type.rb', line 9

def initialize(object)
  @object = object
  freeze
end

Instance Attribute Details

#objectObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
# File 'lib/literal/types/unit_type.rb', line 14

def object
  @object
end

Instance Method Details

#===(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
# File 'lib/literal/types/unit_type.rb', line 16

def ===(value)
  EQUAL_METHOD.bind_call(@object, value)
end

#>=(other) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
23
24
25
26
27
# File 'lib/literal/types/unit_type.rb', line 20

def >=(other)
  case other
  when Literal::Types::UnitType
    EQUAL_METHOD.bind_call(@object, other.object)
  else
    false
  end
end