class AudioAddict::Commands::APICmd

Public Instance Methods

run() click to toggle source
# File lib/audio_addict/commands/api.rb, line 17
def run
  needs :network
  response = api.send(api_method, endpoint)
  puts response.to_yaml
end

Private Instance Methods

api() click to toggle source
# File lib/audio_addict/commands/api.rb, line 35
def api
  @api ||= API.new current_network
end
api_method() click to toggle source
# File lib/audio_addict/commands/api.rb, line 25
def api_method
  return :post if args["post"]
  return :delete if args["delete"]
  return :get
end
endpoint() click to toggle source
# File lib/audio_addict/commands/api.rb, line 31
def endpoint
  args["ENDPOINT"]
end