Class: TFClient::Models::Model

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line:) ⇒ Model

Returns a new instance of Model.



20
21
22
23
24
25
26
# File 'lib/textflight-client/models/model.rb', line 20

def initialize(line:)
  tokens = ResponseParser.tokenize_line(line: line)
  tokens_hash = ResponseParser.label_and_translation(tokens: tokens)
  @label = tokens_hash[:label]
  @translation = tokens_hash[:translation]
  @values_hash = ResponseParser.hash_from_line_values(line: line)
end

Instance Attribute Details

#labelObject

Returns the value of attribute label.



18
19
20
# File 'lib/textflight-client/models/model.rb', line 18

def label
  @label
end

#translationObject

Returns the value of attribute translation.



18
19
20
# File 'lib/textflight-client/models/model.rb', line 18

def translation
  @translation
end

#values_hashObject

Returns the value of attribute values_hash.



18
19
20
# File 'lib/textflight-client/models/model.rb', line 18

def values_hash
  @values_hash
end