Class: Put::PutsThing::NilOrder

Inherits:
Put::PutsThing show all
Defined in:
lib/put/puts_thing/nil_order.rb

Direct Known Subclasses

NilsFirst, NilsLast

Instance Method Summary collapse

Methods inherited from Put::PutsThing

#<=>, #nils_first?, #reverse?

Constructor Details

#initialize(value) ⇒ NilOrder

Returns a new instance of NilOrder.



4
5
6
# File 'lib/put/puts_thing/nil_order.rb', line 4

def initialize(value)
  @value = value
end

Instance Method Details

#valueObject



8
9
10
11
12
13
14
# File 'lib/put/puts_thing/nil_order.rb', line 8

def value
  if @value.nil?
    nil
  else
    0
  end
end