Class: TFClient::Models::Coordinates

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

Instance Attribute Summary collapse

Attributes inherited from Model

#label, #translation, #values_hash

Instance Method Summary collapse

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

#xObject (readonly)

Returns the value of attribute x.



102
103
104
# File 'lib/textflight-client/models/nav.rb', line 102

def x
  @x
end

#yObject (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_sObject



110
111
112
# File 'lib/textflight-client/models/nav.rb', line 110

def to_s
  %Q[#{@translation}: (#{@x},#{@y})]
end