Class: Dropcam::Camera
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#download_host ⇒ Object
readonly
Returns the value of attribute download_host.
-
#download_server_live ⇒ Object
readonly
Returns the value of attribute download_server_live.
-
#hours_of_recording_max ⇒ Object
readonly
Returns the value of attribute hours_of_recording_max.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_connected ⇒ Object
readonly
Returns the value of attribute is_connected.
-
#is_online ⇒ Object
readonly
Returns the value of attribute is_online.
-
#is_public ⇒ Object
readonly
Returns the value of attribute is_public.
-
#is_streaming ⇒ Object
readonly
Returns the value of attribute is_streaming.
-
#notification_devices ⇒ Object
readonly
Returns the value of attribute notification_devices.
-
#owner_id ⇒ Object
readonly
Returns the value of attribute owner_id.
-
#public_token ⇒ Object
readonly
Returns the value of attribute public_token.
-
#settings(force = false) ⇒ Object
Returns the value of attribute settings.
-
#timezone ⇒ Object
readonly
Returns the value of attribute timezone.
-
#timezone_utc_offset ⇒ Object
readonly
Returns the value of attribute timezone_utc_offset.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Attributes inherited from Base
Instance Method Summary collapse
- #clip ⇒ Object
- #cuepoint ⇒ Object
-
#initialize(uuid, properties = {}) ⇒ Camera
constructor
A new instance of Camera.
- #notification ⇒ Object
- #properties=(properties) ⇒ Object
- #public=(is_public) ⇒ Object
- #public? ⇒ Boolean
- #screenshot ⇒ Object
- #set_public_token(token) ⇒ Object
- #stream ⇒ Object
- #update_info ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(uuid, properties = {}) ⇒ Camera
Returns a new instance of Camera.
21 22 23 24 25 |
# File 'lib/dropcam/camera.rb', line 21 def initialize(uuid, properties={}) @uuid = uuid @settings = {} self.properties = properties end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
16 17 18 |
# File 'lib/dropcam/camera.rb', line 16 def description @description end |
#download_host ⇒ Object (readonly)
Returns the value of attribute download_host.
15 16 17 |
# File 'lib/dropcam/camera.rb', line 15 def download_host @download_host end |
#download_server_live ⇒ Object (readonly)
Returns the value of attribute download_server_live.
15 16 17 |
# File 'lib/dropcam/camera.rb', line 15 def download_server_live @download_server_live end |
#hours_of_recording_max ⇒ Object (readonly)
Returns the value of attribute hours_of_recording_max.
16 17 18 |
# File 'lib/dropcam/camera.rb', line 16 def hours_of_recording_max @hours_of_recording_max end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
17 18 19 |
# File 'lib/dropcam/camera.rb', line 17 def id @id end |
#is_connected ⇒ Object (readonly)
Returns the value of attribute is_connected.
16 17 18 |
# File 'lib/dropcam/camera.rb', line 16 def is_connected @is_connected end |
#is_online ⇒ Object (readonly)
Returns the value of attribute is_online.
16 17 18 |
# File 'lib/dropcam/camera.rb', line 16 def is_online @is_online end |
#is_public ⇒ Object (readonly)
Returns the value of attribute is_public.
16 17 18 |
# File 'lib/dropcam/camera.rb', line 16 def is_public @is_public end |
#is_streaming ⇒ Object (readonly)
Returns the value of attribute is_streaming.
15 16 17 |
# File 'lib/dropcam/camera.rb', line 15 def is_streaming @is_streaming end |
#notification_devices ⇒ Object (readonly)
Returns the value of attribute notification_devices.
15 16 17 |
# File 'lib/dropcam/camera.rb', line 15 def notification_devices @notification_devices end |
#owner_id ⇒ Object (readonly)
Returns the value of attribute owner_id.
17 18 19 |
# File 'lib/dropcam/camera.rb', line 17 def owner_id @owner_id end |
#public_token ⇒ Object (readonly)
Returns the value of attribute public_token.
15 16 17 |
# File 'lib/dropcam/camera.rb', line 15 def public_token @public_token end |
#settings(force = false) ⇒ Object
Returns the value of attribute settings.
18 19 20 |
# File 'lib/dropcam/camera.rb', line 18 def settings @settings end |
#timezone ⇒ Object (readonly)
Returns the value of attribute timezone.
16 17 18 |
# File 'lib/dropcam/camera.rb', line 16 def timezone @timezone end |
#timezone_utc_offset ⇒ Object (readonly)
Returns the value of attribute timezone_utc_offset.
16 17 18 |
# File 'lib/dropcam/camera.rb', line 16 def timezone_utc_offset @timezone_utc_offset end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
15 16 17 |
# File 'lib/dropcam/camera.rb', line 15 def title @title end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
17 18 19 |
# File 'lib/dropcam/camera.rb', line 17 def type @type end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
15 16 17 |
# File 'lib/dropcam/camera.rb', line 15 def uuid @uuid end |
Instance Method Details
#clip ⇒ Object
56 57 58 59 |
# File 'lib/dropcam/camera.rb', line 56 def clip @clip_base = ClipBase.new(self) unless @clip_base @clip_base end |
#cuepoint ⇒ Object
60 61 62 63 |
# File 'lib/dropcam/camera.rb', line 60 def cuepoint @cuepoint_base = CuepointBase.new(self) unless @cuepoint_base @cuepoint_base end |
#notification ⇒ Object
70 71 72 73 |
# File 'lib/dropcam/camera.rb', line 70 def notification @notification = NotifcationBase.new(self) unless @notification @notification end |
#properties=(properties) ⇒ Object
27 28 29 30 31 |
# File 'lib/dropcam/camera.rb', line 27 def properties=(properties) properties.each{|key, value| instance_variable_set("@#{key}", value) } end |
#public=(is_public) ⇒ Object
84 85 86 87 |
# File 'lib/dropcam/camera.rb', line 84 def public=(is_public) response = post(::CAMERAS_UPDATE, {"uuid"=>@uuid, "is_public"=>is_public, "accepted_public_terms_at" => "true"}, @cookies) self.properties = JSON.parse(response.body)["items"][0] end |
#public? ⇒ Boolean
89 90 91 |
# File 'lib/dropcam/camera.rb', line 89 def public? @is_public end |
#screenshot ⇒ Object
51 52 53 54 |
# File 'lib/dropcam/camera.rb', line 51 def screenshot @screenshot = Screenshot.new(self) unless @screenshot @screenshot end |
#set_public_token(token) ⇒ Object
93 94 95 96 97 |
# File 'lib/dropcam/camera.rb', line 93 def set_public_token(token) response = post(::CAMERAS_UPDATE, {"uuid"=>@uuid, "token"=>token}, @cookies) self.properties = JSON.parse(response.body)["items"][0] true end |
#stream ⇒ Object
65 66 67 68 |
# File 'lib/dropcam/camera.rb', line 65 def stream @stream = Stream.new(self) unless @stream @stream end |
#update_info ⇒ Object
76 77 78 79 80 |
# File 'lib/dropcam/camera.rb', line 76 def update_info response = get(::CAMERAS_GET, {"id"=>@uuid}, @cookies) self.properties = JSON.parse(response.body)["items"][0] end |