Class: Dropcam::ClipBase
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #all ⇒ Object
- #archive ⇒ Object
- #create(length, start_date, title, description) ⇒ Object
-
#initialize(camera) ⇒ ClipBase
constructor
A new instance of ClipBase.
Methods inherited from Base
Constructor Details
#initialize(camera) ⇒ ClipBase
Returns a new instance of ClipBase.
5 6 7 |
# File 'lib/dropcam/clip_base.rb', line 5 def initialize(camera) @camera = camera end |
Instance Method Details
#all ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/dropcam/clip_base.rb', line 9 def all response = get(::CLIP_GET_ALL,{},@camera.) clips = [] all_clips = JSON.parse(response.body)["items"] for clip in all_clips c = Clip.new(@camera, clip) if c.camera_id == @camera.id clips.push c end end clips end |
#archive ⇒ Object
22 23 24 |
# File 'lib/dropcam/clip_base.rb', line 22 def archive ClipArchive.new(@camera) end |
#create(length, start_date, title, description) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/dropcam/clip_base.rb', line 26 def create(length, start_date, title, description) params = {"uuid"=>@camera.uuid, "length" => length, "start_date" => start_date, "title" => title, "description" => description} response = post(::VIDEOS_REQUEST, params, @camera.) clip_info = JSON.parse(response.body)["items"][0] return Clip.new(@camera, clip_info) end |