Class: Twurl::Options
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Twurl::Options
- Defined in:
- lib/twurl/cli.rb
Constant Summary collapse
- DEFAULT_REQUEST_METHOD =
'get'
- DEFAULT_HOST =
'api.twitter.com'
- DEFAULT_PROTOCOL =
'https'
Instance Method Summary collapse
- #base_url ⇒ Object
- #debug_output_io ⇒ Object
- #host ⇒ Object
- #oauth_client_options ⇒ Object
- #protocol ⇒ Object
- #proxy ⇒ Object
- #request_method ⇒ Object
- #ssl? ⇒ Boolean
Instance Method Details
#base_url ⇒ Object
333 334 335 |
# File 'lib/twurl/cli.rb', line 333 def base_url "#{protocol}://#{host}" end |
#debug_output_io ⇒ Object
341 342 343 |
# File 'lib/twurl/cli.rb', line 341 def debug_output_io super || STDERR end |
#host ⇒ Object
353 354 355 |
# File 'lib/twurl/cli.rb', line 353 def host super || DEFAULT_HOST end |
#oauth_client_options ⇒ Object
326 327 328 329 330 331 |
# File 'lib/twurl/cli.rb', line 326 def OAuthClient::OAUTH_CLIENT_OPTIONS.inject({}) do |, option| [option] = send(option) end end |
#protocol ⇒ Object
349 350 351 |
# File 'lib/twurl/cli.rb', line 349 def protocol super || DEFAULT_PROTOCOL end |
#proxy ⇒ Object
357 358 359 |
# File 'lib/twurl/cli.rb', line 357 def proxy super || nil end |
#request_method ⇒ Object
345 346 347 |
# File 'lib/twurl/cli.rb', line 345 def request_method super || (data.empty? ? DEFAULT_REQUEST_METHOD : 'post') end |
#ssl? ⇒ Boolean
337 338 339 |
# File 'lib/twurl/cli.rb', line 337 def ssl? protocol == 'https' end |