class Embedly::CommandLine

Public Class Methods

new(args) click to toggle source
# File lib/embedly/command_line.rb, line 121
def initialize(args)
  @options, @args = {}, args
end
run!(endpoint, args = []) click to toggle source
# File lib/embedly/command_line.rb, line 116
def run!(endpoint, args = [])
  new(args).run(endpoint)
end

Public Instance Methods

options() click to toggle source
# File lib/embedly/command_line.rb, line 131
def options
  @options = Parser.parse!(@args.dup)
  @options
end
run(endpoint = :oembed) click to toggle source
# File lib/embedly/command_line.rb, line 125
def run(endpoint = :oembed)
  api_options = options.dup
  query = api_options.delete(:query)
  Embedly::API.new(api_options).send(endpoint, query)
end