Class: Embedly::CommandLine
- Inherits:
-
Object
- Object
- Embedly::CommandLine
- Defined in:
- lib/embedly/command_line.rb
Defined Under Namespace
Classes: Parser
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args) ⇒ CommandLine
constructor
A new instance of CommandLine.
- #options ⇒ Object
- #run(endpoint = :oembed) ⇒ Object
Constructor Details
#initialize(args) ⇒ CommandLine
Returns a new instance of CommandLine.
117 118 119 |
# File 'lib/embedly/command_line.rb', line 117 def initialize(args) , @args = {}, args end |
Class Method Details
.run!(endpoint, args = []) ⇒ Object
112 113 114 |
# File 'lib/embedly/command_line.rb', line 112 def run!(endpoint, args = []) new(args).run(endpoint) end |
Instance Method Details
#options ⇒ Object
127 128 129 130 |
# File 'lib/embedly/command_line.rb', line 127 def = Parser.parse!(@args.dup) end |
#run(endpoint = :oembed) ⇒ Object
121 122 123 124 125 |
# File 'lib/embedly/command_line.rb', line 121 def run(endpoint = :oembed) = .dup query = .delete(:query) Embedly::API.new().send(endpoint, query) end |