Class: Eisenhower::RoadUpdate
- Inherits:
-
Object
- Object
- Eisenhower::RoadUpdate
- Defined in:
- lib/eisenhower/road_update.rb
Instance Attribute Summary collapse
-
#app_id ⇒ Object
Returns the value of attribute app_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#road_id ⇒ Object
Returns the value of attribute road_id.
-
#road_map_id ⇒ Object
Returns the value of attribute road_map_id.
-
#staff ⇒ Object
Returns the value of attribute staff.
-
#staff_id ⇒ Object
Returns the value of attribute staff_id.
-
#time ⇒ Object
Returns the value of attribute time.
-
#update ⇒ Object
Returns the value of attribute update.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ RoadUpdate
constructor
A new instance of RoadUpdate.
-
#owner ⇒ Object
Returns the value of attribute staff.
-
#user ⇒ Object
Returns the value of attribute staff.
Constructor Details
#initialize(attributes = {}) ⇒ RoadUpdate
Returns a new instance of RoadUpdate.
7 8 9 |
# File 'lib/eisenhower/road_update.rb', line 7 def initialize(attributes={}) attributes.each { |key, val| send("#{key}=", val) if respond_to?("#{key}=") } end |
Instance Attribute Details
#app_id ⇒ Object
Returns the value of attribute app_id.
3 4 5 |
# File 'lib/eisenhower/road_update.rb', line 3 def app_id @app_id end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/eisenhower/road_update.rb', line 3 def id @id end |
#road_id ⇒ Object
Returns the value of attribute road_id.
3 4 5 |
# File 'lib/eisenhower/road_update.rb', line 3 def road_id @road_id end |
#road_map_id ⇒ Object
Returns the value of attribute road_map_id.
3 4 5 |
# File 'lib/eisenhower/road_update.rb', line 3 def road_map_id @road_map_id end |
#staff ⇒ Object
Returns the value of attribute staff.
3 4 5 |
# File 'lib/eisenhower/road_update.rb', line 3 def staff @staff end |
#staff_id ⇒ Object
Returns the value of attribute staff_id.
3 4 5 |
# File 'lib/eisenhower/road_update.rb', line 3 def staff_id @staff_id end |
#time ⇒ Object
Returns the value of attribute time.
3 4 5 |
# File 'lib/eisenhower/road_update.rb', line 3 def time @time end |
#update ⇒ Object
Returns the value of attribute update.
3 4 5 |
# File 'lib/eisenhower/road_update.rb', line 3 def update @update end |
Class Method Details
.all(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/eisenhower/road_update.rb', line 17 def all(={}) roadmap_id=nil, app_id=nil, limit=3, skip=0 = { :roadmap_id => nil, :app_id => nil, :limit => 3, :skip => 0 }.merge() body = Eisenhower::Client.get_and_parse("/update/listAll/roadmap/#{[:roadmap_id]}/app/#{[:app_id]}/limit/#{[:limit]}/skip/#{[:skip]}") body["updates"].collect{|update| Eisenhower::RoadUpdate.new({ :id => update["_id"], :road_id => update["roadId"], :staff_id => update["staffId"], :time => update["time"], :update => update["update"] })} end |
.find(road_update_id) ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/eisenhower/road_update.rb', line 37 def find(road_update_id) body = Eisenhower::Client.get_and_parse("/update/get/id/#{road_update_id}") Eisenhower::RoadUpdate.new({ :id => body["_id"], :road_id => body["roadId"], :staff_id => body["staffId"], :time => body["time"], :update => body["update"] }) end |
Instance Method Details
#owner ⇒ Object
Returns the value of attribute staff.
5 6 7 |
# File 'lib/eisenhower/road_update.rb', line 5 def staff @staff end |
#user ⇒ Object
Returns the value of attribute staff.
4 5 6 |
# File 'lib/eisenhower/road_update.rb', line 4 def staff @staff end |