Class: LaundryView::Machine

Inherits:
Object
  • Object
show all
Defined in:
lib/laundryview/main.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status) ⇒ Machine

Returns a new instance of Machine.



55
56
57
58
59
60
61
62
63
# File 'lib/laundryview/main.rb', line 55

def initialize status
  if status == "out of service"
    @broken = true
    @remaining = 0
  else
    @broken = false
    @remaining = calc_remaining(status)
  end
end

Instance Attribute Details

#brokenObject (readonly)

Returns the value of attribute broken.



52
53
54
# File 'lib/laundryview/main.rb', line 52

def broken
  @broken
end

#kindObject

Returns the value of attribute kind.



53
54
55
# File 'lib/laundryview/main.rb', line 53

def kind
  @kind
end

#remainingObject (readonly)

Returns the value of attribute remaining.



52
53
54
# File 'lib/laundryview/main.rb', line 52

def remaining
  @remaining
end