Class: TFClient::Models::StatusReport

Inherits:
Object
  • Object
show all
Defined in:
lib/textflight-client/models/status_report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hashObject (readonly)

Returns the value of attribute hash.



10
11
12
# File 'lib/textflight-client/models/status_report.rb', line 10

def hash
  @hash
end