Class: FipeApi::FipeResult
- Defined in:
- lib/fipe_api/resources/fipe_result.rb
Instance Attribute Summary collapse
-
#authentication ⇒ Object
Returns the value of attribute authentication.
-
#fuel ⇒ Object
Returns the value of attribute fuel.
-
#id ⇒ Object
Returns the value of attribute id.
-
#price ⇒ Object
Returns the value of attribute price.
-
#query_time ⇒ Object
Returns the value of attribute query_time.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(id, year, fuel, authentication, price, query_time) ⇒ FipeResult
constructor
A new instance of FipeResult.
- #url ⇒ Object
Constructor Details
#initialize(id, year, fuel, authentication, price, query_time) ⇒ FipeResult
Returns a new instance of FipeResult.
10 11 12 13 14 15 16 17 |
# File 'lib/fipe_api/resources/fipe_result.rb', line 10 def initialize(id, year, fuel, authentication, price, query_time) self.id = id self.authentication = authentication self.year = year self.fuel = fuel self.price = price self.query_time = query_time end |
Instance Attribute Details
#authentication ⇒ Object
Returns the value of attribute authentication.
4 5 6 |
# File 'lib/fipe_api/resources/fipe_result.rb', line 4 def authentication @authentication end |
#fuel ⇒ Object
Returns the value of attribute fuel.
6 7 8 |
# File 'lib/fipe_api/resources/fipe_result.rb', line 6 def fuel @fuel end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/fipe_api/resources/fipe_result.rb', line 3 def id @id end |
#price ⇒ Object
Returns the value of attribute price.
7 8 9 |
# File 'lib/fipe_api/resources/fipe_result.rb', line 7 def price @price end |
#query_time ⇒ Object
Returns the value of attribute query_time.
8 9 10 |
# File 'lib/fipe_api/resources/fipe_result.rb', line 8 def query_time @query_time end |
#year ⇒ Object
Returns the value of attribute year.
5 6 7 |
# File 'lib/fipe_api/resources/fipe_result.rb', line 5 def year @year end |
Instance Method Details
#url ⇒ Object
20 21 22 23 24 |
# File 'lib/fipe_api/resources/fipe_result.rb', line 20 def url "http://www.fipe.org.br/pt-br/indices/veiculos/#{year.model.brand.vehicle.name_id}/" + "#{year.model.brand.name.downcase}/#{year.model.brand.table.month}-#{year.model.brand.table.year}/" + "#{self.id}/#{self.year.id}/g/#{self.authentication}" end |