Class: TFClient::Models::Coordinates
- Defined in:
- lib/textflight-client/models/nav.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Attributes inherited from Model
#label, #translation, #values_hash
Instance Method Summary collapse
-
#initialize(line:) ⇒ Coordinates
constructor
A new instance of Coordinates.
- #to_s ⇒ Object
Constructor Details
#initialize(line:) ⇒ Coordinates
Returns a new instance of Coordinates.
104 105 106 107 108 |
# File 'lib/textflight-client/models/nav.rb', line 104 def initialize(line:) super(line: line) @x = @values_hash[:x].to_i @y = @values_hash[:y].to_i end |
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
102 103 104 |
# File 'lib/textflight-client/models/nav.rb', line 102 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
102 103 104 |
# File 'lib/textflight-client/models/nav.rb', line 102 def y @y end |
Instance Method Details
#to_s ⇒ Object
110 111 112 |
# File 'lib/textflight-client/models/nav.rb', line 110 def to_s %Q[#{@translation}: (#{@x},#{@y})] end |