Class: Dropcam::Clip
Instance Attribute Summary collapse
-
#camera_id ⇒ Object
readonly
Returns the value of attribute camera_id.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#generated_time ⇒ Object
readonly
Returns the value of attribute generated_time.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_error ⇒ Object
readonly
Returns the value of attribute is_error.
-
#length_in_seconds ⇒ Object
readonly
Returns the value of attribute length_in_seconds.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#public_link ⇒ Object
readonly
Returns the value of attribute public_link.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Attributes inherited from Base
Instance Method Summary collapse
-
#destroy ⇒ Object
def title=(title) return false unless @id response = post(::CLIP_DELETE, { “id” => @id, “title” => title }, @camera.cookies) true end.
- #direct_link ⇒ Object
- #direct_screenshot_link ⇒ Object
-
#initialize(camera, properties = nil) ⇒ Clip
constructor
A new instance of Clip.
Methods inherited from ClipBase
Methods inherited from Base
Constructor Details
#initialize(camera, properties = nil) ⇒ Clip
Returns a new instance of Clip.
9 10 11 12 |
# File 'lib/dropcam/clip.rb', line 9 def initialize(camera, properties = nil) super(camera) self.properties = properties end |
Instance Attribute Details
#camera_id ⇒ Object (readonly)
Returns the value of attribute camera_id.
5 6 7 |
# File 'lib/dropcam/clip.rb', line 5 def camera_id @camera_id end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/dropcam/clip.rb', line 5 def description @description end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
6 7 8 |
# File 'lib/dropcam/clip.rb', line 6 def filename @filename end |
#generated_time ⇒ Object (readonly)
Returns the value of attribute generated_time.
5 6 7 |
# File 'lib/dropcam/clip.rb', line 5 def generated_time @generated_time end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/dropcam/clip.rb', line 5 def id @id end |
#is_error ⇒ Object (readonly)
Returns the value of attribute is_error.
5 6 7 |
# File 'lib/dropcam/clip.rb', line 5 def is_error @is_error end |
#length_in_seconds ⇒ Object (readonly)
Returns the value of attribute length_in_seconds.
6 7 8 |
# File 'lib/dropcam/clip.rb', line 6 def length_in_seconds @length_in_seconds end |
#properties ⇒ Object
Returns the value of attribute properties.
8 9 10 |
# File 'lib/dropcam/clip.rb', line 8 def properties @properties end |
#public_link ⇒ Object (readonly)
Returns the value of attribute public_link.
5 6 7 |
# File 'lib/dropcam/clip.rb', line 5 def public_link @public_link end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
5 6 7 |
# File 'lib/dropcam/clip.rb', line 5 def server @server end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
5 6 7 |
# File 'lib/dropcam/clip.rb', line 5 def start_time @start_time end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/dropcam/clip.rb', line 5 def title @title end |
Instance Method Details
#destroy ⇒ Object
def title=(title)
return false unless @id
response = post(::CLIP_DELETE, { "id" => @id, "title" => title }, @camera.)
true
end
27 28 29 30 31 |
# File 'lib/dropcam/clip.rb', line 27 def destroy return false unless @id response = post(::CLIP_DELETE, { "id" => @id }, @camera.) true end |
#direct_link ⇒ Object
33 34 35 |
# File 'lib/dropcam/clip.rb', line 33 def direct_link return "https://#{@server}/#{@filename}" end |
#direct_screenshot_link ⇒ Object
36 37 38 |
# File 'lib/dropcam/clip.rb', line 36 def direct_screenshot_link return "https://#{@server}/s3#{File.basename(@filename, File.extname(@filename))}.jpg" end |