Class: TripIt::MapObject
- Inherits:
-
BaseObject
- Object
- Base
- BaseObject
- TripIt::MapObject
- Defined in:
- lib/trip_it/classes/objects/map_object.rb
Instance Attribute Summary
Attributes inherited from BaseObject
#id, #is_client_traveler, #relative_url
Instance Method Summary collapse
-
#initialize(client, obj_id = nil, source = nil) ⇒ MapObject
constructor
A new instance of MapObject.
- #populate(source) ⇒ Object
- #sequence ⇒ Object
Methods inherited from BaseObject
Methods inherited from Base
#Boolean, #camelize, #chkAndPopulate, #chkObjAndPopulate, #convertDT, #to_hash, #to_json, #to_xml
Methods included from ParamUtil
#address_param, #airportcode_param, #array_param, #boolean_param, #boolean_read_param, #camelize, #date_param, #datetime_param, #exceptions, #float_param, #integer_param, #string_param, #time_param, #traveler_array_param, #traveler_param
Constructor Details
#initialize(client, obj_id = nil, source = nil) ⇒ MapObject
Returns a new instance of MapObject.
6 7 8 9 10 11 12 |
# File 'lib/trip_it/classes/objects/map_object.rb', line 6 def initialize(client, obj_id = nil, source = nil) @client = client unless obj_id.nil? @obj_id = obj_id populate(source) end end |
Instance Method Details
#populate(source) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/trip_it/classes/objects/map_object.rb', line 14 def populate(source) info = source || @client.get("/map", :id => @obj_id)["MapObject"] super(info) @date_time = convertDT(info["DateTime"]) @address = TripIt::Address.new(info["Address"]) unless info["Address"].nil? end |
#sequence ⇒ Object
21 22 23 24 |
# File 'lib/trip_it/classes/objects/map_object.rb', line 21 def sequence arr = super arr + ["@date_time","@address"] end |