Class: Spassky::DeviceTestStatus
- Inherits:
-
Object
- Object
- Spassky::DeviceTestStatus
- Defined in:
- lib/spassky/device_test_status.rb
Instance Attribute Summary collapse
-
#device_id ⇒ Object
Returns the value of attribute device_id.
-
#message ⇒ Object
Returns the value of attribute message.
-
#status ⇒ Object
Returns the value of attribute status.
-
#test_name ⇒ Object
Returns the value of attribute test_name.
Class Method Summary collapse
Instance Method Summary collapse
- #completed? ⇒ Boolean
- #in_progress? ⇒ Boolean
-
#initialize(options = {}) ⇒ DeviceTestStatus
constructor
A new instance of DeviceTestStatus.
Constructor Details
#initialize(options = {}) ⇒ DeviceTestStatus
Returns a new instance of DeviceTestStatus.
5 6 7 8 9 10 |
# File 'lib/spassky/device_test_status.rb', line 5 def initialize( = {}) @device_id = [:device_id] @test_name = [:test_name] @status = [:status] @message = [:message] end |
Instance Attribute Details
#device_id ⇒ Object
Returns the value of attribute device_id.
3 4 5 |
# File 'lib/spassky/device_test_status.rb', line 3 def device_id @device_id end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/spassky/device_test_status.rb', line 3 def @message end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/spassky/device_test_status.rb', line 3 def status @status end |
#test_name ⇒ Object
Returns the value of attribute test_name.
3 4 5 |
# File 'lib/spassky/device_test_status.rb', line 3 def test_name @test_name end |
Class Method Details
.from_hash(hash) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/spassky/device_test_status.rb', line 20 def self.from_hash hash DeviceTestStatus.new({ :device_id => hash["device_id"], :test_name => hash["test_name"], :status => hash["status"], :message => hash["message"]} ) end |
Instance Method Details
#completed? ⇒ Boolean
16 17 18 |
# File 'lib/spassky/device_test_status.rb', line 16 def completed? @status != "in progress" end |
#in_progress? ⇒ Boolean
12 13 14 |
# File 'lib/spassky/device_test_status.rb', line 12 def in_progress? @status == "in progress" end |