Module: Lapse::Client::Clips

Included in:
Lapse::Client
Defined in:
lib/lapse/client/clips.rb

Overview

Client methods for working with clips

Instance Method Summary collapse

Instance Method Details

#all_clipsObject



5
6
7
# File 'lib/lapse/client/clips.rb', line 5

def all_clips
  get('clips').body
end

#clip(clip_id) ⇒ Object



13
14
15
16
17
# File 'lib/lapse/client/clips.rb', line 13

def clip(clip_id)
  params = {}
  params[:slug] = true if clip_id.is_a?(String)
  get("clips/#{clip_id}", params).body
end

#create_clipObject



19
20
21
# File 'lib/lapse/client/clips.rb', line 19

def create_clip
  post('clips').body
end

#destroy_clip(clip_id) ⇒ Object



59
60
61
# File 'lib/lapse/client/clips.rb', line 59

def destroy_clip(clip_id)
  boolean_from_response(:delete, "clips/#{clip_id}")
end


9
10
11
# File 'lib/lapse/client/clips.rb', line 9

def featured_clips
  get('clips/featured').body
end

#flag_clip(clip_id) ⇒ Object



51
52
53
# File 'lib/lapse/client/clips.rb', line 51

def flag_clip(clip_id)
  boolean_from_response(:post, "clips/#{clip_id}/flag")
end

#modify_frames(clip_id, publish_ids, unpublish_ids) ⇒ Object



35
36
37
38
39
40
41
42
# File 'lib/lapse/client/clips.rb', line 35

def modify_frames(clip_id, publish_ids, unpublish_ids)
  params = {
    publish_ids: publish_ids,
    unpublish_ids: unpublish_ids
  }

  post("clips/#{clip_id}/modify_frames", params).body
end

#publish_clip(clip_id, options = {}) ⇒ Object



44
45
46
47
48
49
# File 'lib/lapse/client/clips.rb', line 44

def publish_clip(clip_id, options = {})
  params = {
    :clip => options
  }
  post("clips/#{clip_id}/publish", params).body
end

#submit_frames(clip_id, frame_ids) ⇒ Object



28
29
30
31
32
33
# File 'lib/lapse/client/clips.rb', line 28

def submit_frames(clip_id, frame_ids)
  params = {
    :frame_ids => frame_ids
  }
  post("clips/#{clip_id}/submit_frames", params).body
end

#unflag_clip(clip_id) ⇒ Object



55
56
57
# File 'lib/lapse/client/clips.rb', line 55

def unflag_clip(clip_id)
  post("clips/#{clip_id}/unflag").body
end

#update_clip(clip_id, options) ⇒ Object



23
24
25
26
# File 'lib/lapse/client/clips.rb', line 23

def update_clip(clip_id, options)
  params = { clip: options }
  patch("clips/#{clip_id}", params).body
end