class Stagebloc

Constants

BASE_URL

Public Class Methods

new(client_id) click to toggle source
# File lib/stagebloc.rb, line 5
def initialize client_id
  @client ||= "client_id=#{client_id}"
end

Public Instance Methods

account(account_id) click to toggle source
# File lib/stagebloc.rb, line 9
def account account_id
  get "#{BASE_URL}/account/#{account_id}?#{@client}"
end
children_for_account(account_id) click to toggle source
# File lib/stagebloc.rb, line 13
def children_for_account account_id
  get("#{BASE_URL}/account/#{account_id}/children?#{@client}")['child_accounts']
end
get_audio(account_id, audio_id) click to toggle source
# File lib/stagebloc.rb, line 17
def get_audio account_id, audio_id
  get "#{BASE_URL}/account/#{account_id}/audio/#{audio_id}?#{@client}"
end

Private Instance Methods

get(url) click to toggle source
# File lib/stagebloc.rb, line 22
def get url
  parse_response(HTTParty.get(url).body)['data']
end
parse_response(resp) click to toggle source
# File lib/stagebloc.rb, line 26
def parse_response resp
  JSON.parse(resp)
end