Class: TFClient::Models::StatusReport
- Inherits:
-
Object
- Object
- TFClient::Models::StatusReport
- Defined in:
- lib/textflight-client/models/status_report.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
Instance Method Summary collapse
-
#initialize(lines:) ⇒ StatusReport
constructor
A new instance of StatusReport.
Constructor Details
#initialize(lines:) ⇒ StatusReport
Returns a new instance of StatusReport.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/textflight-client/models/status_report.rb', line 12 def initialize(lines:) if lines[0] != STATUS_BEGIN raise "Expected lines[0] to be == #{STATUS_BEGIN}, found: #{lines[0]}" end @hash = {} lines.each do |line| break if line == STATUS_END tokens = line.strip.split(": ") @hash[tokens[0].to_sym] = tokens[1] end end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
10 11 12 |
# File 'lib/textflight-client/models/status_report.rb', line 10 def hash @hash end |