Class: EatabitRails::Printer
- Inherits:
-
Object
- Object
- EatabitRails::Printer
- Defined in:
- lib/eatabit_rails/printer.rb
Instance Attribute Summary collapse
-
#autoprint ⇒ Object
readonly
Returns the value of attribute autoprint.
-
#delivery_minutes ⇒ Object
readonly
Returns the value of attribute delivery_minutes.
-
#enabled ⇒ Object
readonly
Returns the value of attribute enabled.
-
#fulfillment ⇒ Object
readonly
Returns the value of attribute fulfillment.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#light ⇒ Object
readonly
Returns the value of attribute light.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#online ⇒ Object
readonly
Returns the value of attribute online.
-
#paper ⇒ Object
readonly
Returns the value of attribute paper.
-
#pickup_minutes ⇒ Object
readonly
Returns the value of attribute pickup_minutes.
-
#sound ⇒ Object
readonly
Returns the value of attribute sound.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Printer
constructor
A new instance of Printer.
Constructor Details
#initialize(attributes) ⇒ Printer
Returns a new instance of Printer.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/eatabit_rails/printer.rb', line 18 def initialize(attributes) @id = attributes['id'] @name = attributes['name'] @enabled = attributes['enabled'] @pickup_minutes = attributes['pickup_minutes'] @delivery_minutes = attributes['delivery_minutes'] @state = attributes['state'] @online = attributes['online'] @paper = attributes['paper'] @fulfillment = attributes['fulfillment'] @sound = attributes['sound'] @light = attributes['light'] @autoprint = attributes['autoprint'] end |
Instance Attribute Details
#autoprint ⇒ Object (readonly)
Returns the value of attribute autoprint.
5 6 7 |
# File 'lib/eatabit_rails/printer.rb', line 5 def autoprint @autoprint end |
#delivery_minutes ⇒ Object (readonly)
Returns the value of attribute delivery_minutes.
5 6 7 |
# File 'lib/eatabit_rails/printer.rb', line 5 def delivery_minutes @delivery_minutes end |
#enabled ⇒ Object (readonly)
Returns the value of attribute enabled.
5 6 7 |
# File 'lib/eatabit_rails/printer.rb', line 5 def enabled @enabled end |
#fulfillment ⇒ Object (readonly)
Returns the value of attribute fulfillment.
5 6 7 |
# File 'lib/eatabit_rails/printer.rb', line 5 def fulfillment @fulfillment end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/eatabit_rails/printer.rb', line 5 def id @id end |
#light ⇒ Object (readonly)
Returns the value of attribute light.
5 6 7 |
# File 'lib/eatabit_rails/printer.rb', line 5 def light @light end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/eatabit_rails/printer.rb', line 5 def name @name end |
#online ⇒ Object (readonly)
Returns the value of attribute online.
5 6 7 |
# File 'lib/eatabit_rails/printer.rb', line 5 def online @online end |
#paper ⇒ Object (readonly)
Returns the value of attribute paper.
5 6 7 |
# File 'lib/eatabit_rails/printer.rb', line 5 def paper @paper end |
#pickup_minutes ⇒ Object (readonly)
Returns the value of attribute pickup_minutes.
5 6 7 |
# File 'lib/eatabit_rails/printer.rb', line 5 def pickup_minutes @pickup_minutes end |
#sound ⇒ Object (readonly)
Returns the value of attribute sound.
5 6 7 |
# File 'lib/eatabit_rails/printer.rb', line 5 def sound @sound end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
5 6 7 |
# File 'lib/eatabit_rails/printer.rb', line 5 def state @state end |
Class Method Details
.find(id) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/eatabit_rails/printer.rb', line 33 def self.find(id) printer_uri = EatabitRails::REST::Uri.new.printer id params = EatabitRails::REST::Uri.default_params response = RestClient.get printer_uri, params attributes = JSON.parse(response.body)['printer'] new(attributes) end |