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.
121 122 123 |
# File 'lib/embedly/command_line.rb', line 121 def initialize(args) , @args = {}, args end |
Class Method Details
.run!(endpoint, args = []) ⇒ Object
116 117 118 |
# File 'lib/embedly/command_line.rb', line 116 def run!(endpoint, args = []) new(args).run(endpoint) end |
Instance Method Details
#options ⇒ Object
131 132 133 134 |
# File 'lib/embedly/command_line.rb', line 131 def = Parser.parse!(@args.dup) end |
#run(endpoint = :oembed) ⇒ Object
125 126 127 128 129 |
# File 'lib/embedly/command_line.rb', line 125 def run(endpoint = :oembed) = .dup query = .delete(:query) Embedly::API.new().send(endpoint, query) end |