Class: TFClient::Models::Model
- Inherits:
-
Object
- Object
- TFClient::Models::Model
- Defined in:
- lib/textflight-client/models/model.rb
Direct Known Subclasses
Asteroids, Brightness, ClaimedBy, Coordinates, ModelWithItems, OutfitSpace, Owner, ShieldCharge
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
-
#translation ⇒ Object
Returns the value of attribute translation.
-
#values_hash ⇒ Object
Returns the value of attribute values_hash.
Instance Method Summary collapse
-
#initialize(line:) ⇒ Model
constructor
A new instance of Model.
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
#label ⇒ Object
Returns the value of attribute label.
18 19 20 |
# File 'lib/textflight-client/models/model.rb', line 18 def label @label end |
#translation ⇒ Object
Returns the value of attribute translation.
18 19 20 |
# File 'lib/textflight-client/models/model.rb', line 18 def translation @translation end |
#values_hash ⇒ Object
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 |