Class: Uber::Estimate

Inherits:
Base
  • Object
show all
Defined in:
lib/uber/models/estimate.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#[], #initialize

Constructor Details

This class inherits a constructor from Uber::Base

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



3
4
5
# File 'lib/uber/models/estimate.rb', line 3

def errors
  @errors
end

#pickup_estimateObject

Returns the value of attribute pickup_estimate.



3
4
5
# File 'lib/uber/models/estimate.rb', line 3

def pickup_estimate
  @pickup_estimate
end

#priceObject

Returns the value of attribute price.



3
4
5
# File 'lib/uber/models/estimate.rb', line 3

def price
  @price
end

#tripObject

Returns the value of attribute trip.



3
4
5
# File 'lib/uber/models/estimate.rb', line 3

def trip
  @trip
end

Instance Method Details

#humanized_estimateObject



13
14
15
16
17
# File 'lib/uber/models/estimate.rb', line 13

def humanized_estimate
  unless pickup_estimate.nil?
    pickup_estimate.to_i == 1 ? "#{pickup_estimate} minute" : "#{pickup_estimate} minutes"
  end
end