Class: Pickpoint::Device
- Inherits:
-
Struct
- Object
- Struct
- Pickpoint::Device
- Defined in:
- lib/pickpoint/devices.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_location ⇒ Object
Returns the value of attribute last_location.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#name ⇒ Object
Returns the value of attribute name.
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#status ⇒ Object
Returns the value of attribute status.
-
#tracks_count ⇒ Object
Returns the value of attribute tracks_count.
-
#type ⇒ Object
Returns the value of attribute type.
-
#uid ⇒ Object
Returns the value of attribute uid.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at
7 8 9 |
# File 'lib/pickpoint/devices.rb', line 7 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description
7 8 9 |
# File 'lib/pickpoint/devices.rb', line 7 def description @description end |
#id ⇒ Object
Returns the value of attribute id
7 8 9 |
# File 'lib/pickpoint/devices.rb', line 7 def id @id end |
#last_location ⇒ Object
Returns the value of attribute last_location
7 8 9 |
# File 'lib/pickpoint/devices.rb', line 7 def last_location @last_location end |
#metadata ⇒ Object
Returns the value of attribute metadata
7 8 9 |
# File 'lib/pickpoint/devices.rb', line 7 def @metadata end |
#name ⇒ Object
Returns the value of attribute name
7 8 9 |
# File 'lib/pickpoint/devices.rb', line 7 def name @name end |
#secret ⇒ Object
Returns the value of attribute secret
7 8 9 |
# File 'lib/pickpoint/devices.rb', line 7 def secret @secret end |
#status ⇒ Object
Returns the value of attribute status
7 8 9 |
# File 'lib/pickpoint/devices.rb', line 7 def status @status end |
#tracks_count ⇒ Object
Returns the value of attribute tracks_count
7 8 9 |
# File 'lib/pickpoint/devices.rb', line 7 def tracks_count @tracks_count end |
#type ⇒ Object
Returns the value of attribute type
7 8 9 |
# File 'lib/pickpoint/devices.rb', line 7 def type @type end |
#uid ⇒ Object
Returns the value of attribute uid
7 8 9 |
# File 'lib/pickpoint/devices.rb', line 7 def uid @uid end |
#updated_at ⇒ Object
Returns the value of attribute updated_at
7 8 9 |
# File 'lib/pickpoint/devices.rb', line 7 def updated_at @updated_at end |
Class Method Details
.from_hash(d) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/pickpoint/devices.rb', line 12 def self.from_hash(d) d = d.transform_keys(&:to_s) new( id: (d["id"] || 0).to_i, uid: (d["uid"] || "").to_s, name: (d["name"] || "").to_s, status: (d["status"] || "").to_s, description: d["description"], tracks_count: (d["tracksCount"] || 0).to_i, type: (d["type"] || "").to_s, secret: (d["secret"] || "").to_s, metadata: d["metadata"], created_at: (d["createdAt"] || "").to_s, updated_at: (d["updatedAt"] || "").to_s, last_location: d["lastLocation"] ) end |