Class: Dropcam::Screenshot

Inherits:
Base
  • Object
show all
Defined in:
lib/dropcam/screenshot.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#cookies, #session_token

Instance Method Summary collapse

Methods inherited from Base

#delete, #get, #post

Constructor Details

#initialize(name) ⇒ Screenshot

Returns a new instance of Screenshot.



6
7
8
9
10
# File 'lib/dropcam/screenshot.rb', line 6

def initialize(name)
  @camera = camera
  @name = name
  @current_value = value
end

Instance Attribute Details

#cameraObject

Returns the value of attribute camera.



5
6
7
# File 'lib/dropcam/screenshot.rb', line 5

def camera
  @camera
end

Instance Method Details

#current(width = 1200) ⇒ Object



12
13
14
# File 'lib/dropcam/screenshot.rb', line 12

def current(width=1200)
  return image_at_time(nil, width)
end

#image_at_time(timestamp, width = 1200) ⇒ Object



16
17
18
19
20
21
# File 'lib/dropcam/screenshot.rb', line 16

def image_at_time(timestamp, width=1200)
  params = {"uuid"=>@camera.uuid, "width" => width}
  params["time"] = timestamp if timestamp
  response = get(::IMAGE_PATH, params, @camera.cookies, true)      
  return response
end