Class: Dopplr::Trip
- Inherits:
-
Object
- Object
- Dopplr::Trip
- Defined in:
- lib/dopplr/trip.rb
Instance Attribute Summary collapse
-
#city(options = {}) ⇒ Object
readonly
Returns the value of attribute city.
-
#finish ⇒ Object
readonly
Returns the value of attribute finish.
-
#notes ⇒ Object
readonly
Returns the value of attribute notes.
-
#outgoing_transport ⇒ Object
readonly
Returns the value of attribute outgoing_transport.
-
#return_transport ⇒ Object
readonly
Returns the value of attribute return_transport.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#trip_id ⇒ Object
readonly
Returns the value of attribute trip_id.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(client, id) ⇒ Trip
constructor
A new instance of Trip.
- #populate ⇒ Object
Constructor Details
#initialize(client, id) ⇒ Trip
Returns a new instance of Trip.
6 7 8 9 10 |
# File 'lib/dopplr/trip.rb', line 6 def initialize(client, id) @client = client @trip_id = id populate end |
Instance Attribute Details
#city(options = {}) ⇒ Object (readonly)
Returns the value of attribute city.
3 4 5 |
# File 'lib/dopplr/trip.rb', line 3 def city @city end |
#finish ⇒ Object (readonly)
Returns the value of attribute finish.
3 4 5 |
# File 'lib/dopplr/trip.rb', line 3 def finish @finish end |
#notes ⇒ Object (readonly)
Returns the value of attribute notes.
3 4 5 |
# File 'lib/dopplr/trip.rb', line 3 def notes @notes end |
#outgoing_transport ⇒ Object (readonly)
Returns the value of attribute outgoing_transport.
3 4 5 |
# File 'lib/dopplr/trip.rb', line 3 def outgoing_transport @outgoing_transport end |
#return_transport ⇒ Object (readonly)
Returns the value of attribute return_transport.
3 4 5 |
# File 'lib/dopplr/trip.rb', line 3 def return_transport @return_transport end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
3 4 5 |
# File 'lib/dopplr/trip.rb', line 3 def start @start end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
3 4 5 |
# File 'lib/dopplr/trip.rb', line 3 def @tags end |
#trip_id ⇒ Object (readonly)
Returns the value of attribute trip_id.
4 5 6 |
# File 'lib/dopplr/trip.rb', line 4 def trip_id @trip_id end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/dopplr/trip.rb', line 4 def url @url end |
Instance Method Details
#populate ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/dopplr/trip.rb', line 12 def populate info = @client.get('trip_info', :trip_id => @trip_id)['trip'] @outgoing_transport = info['outgoing_transport_type'] @return_transport = info['return_transport_type'] @tags = info['tag'] @notes = info['note'] @url = info['url'] @start = Time.parse info['start'] @finish = Time.parse info['finish'] end |