Class: LunaPark::Values::Single
- Inherits:
-
Object
- Object
- LunaPark::Values::Single
- Defined in:
- lib/luna_park/values/single.rb
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value) ⇒ Single
constructor
A new instance of Single.
- #inspect ⇒ Object
- #serialize ⇒ Object
Constructor Details
#initialize(value) ⇒ Single
Returns a new instance of Single.
14 15 16 |
# File 'lib/luna_park/values/single.rb', line 14 def initialize(value) @value = value end |
Class Method Details
.wrap(input) ⇒ Object
8 9 10 11 12 |
# File 'lib/luna_park/values/single.rb', line 8 def self.wrap(input) return input if input.is_a?(self) raise Errors::Unwrapable, "#{self} can not wrap #{input.class}" end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 |
# File 'lib/luna_park/values/single.rb', line 18 def ==(other) value == other.value end |
#inspect ⇒ Object
26 27 28 |
# File 'lib/luna_park/values/single.rb', line 26 def inspect "#<#{self.class} #{value.inspect}>" end |
#serialize ⇒ Object
22 23 24 |
# File 'lib/luna_park/values/single.rb', line 22 def serialize value end |