Class: Transit::Wrapper

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/transit/transit_types.rb

Direct Known Subclasses

ByteArray, Symbol

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Wrapper

Returns a new instance of Wrapper.



23
24
25
# File 'lib/transit/transit_types.rb', line 23

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21
22
23
# File 'lib/transit/transit_types.rb', line 21

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



27
28
29
# File 'lib/transit/transit_types.rb', line 27

def ==(other)
  other.is_a?(self.class) && @value == other.value
end

#inspectObject



32
33
34
# File 'lib/transit/transit_types.rb', line 32

def inspect
  "<#{self.class} \"#{to_s}\">"
end