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
373 374 375 |
# File 'lib/twurl/cli.rb', line 373 def base_url "#{protocol}://#{host}" end |
#debug_output_io ⇒ Object
381 382 383 |
# File 'lib/twurl/cli.rb', line 381 def debug_output_io super || STDERR end |
#host ⇒ Object
393 394 395 |
# File 'lib/twurl/cli.rb', line 393 def host super || DEFAULT_HOST end |
#oauth_client_options ⇒ Object
366 367 368 369 370 371 |
# File 'lib/twurl/cli.rb', line 366 def OAuthClient::OAUTH_CLIENT_OPTIONS.inject({}) do |, option| [option] = send(option) end end |
#protocol ⇒ Object
389 390 391 |
# File 'lib/twurl/cli.rb', line 389 def protocol super || DEFAULT_PROTOCOL end |
#proxy ⇒ Object
397 398 399 |
# File 'lib/twurl/cli.rb', line 397 def proxy super || nil end |
#request_method ⇒ Object
385 386 387 |
# File 'lib/twurl/cli.rb', line 385 def request_method super || (data.empty? ? DEFAULT_REQUEST_METHOD : 'post') end |
#ssl? ⇒ Boolean
377 378 379 |
# File 'lib/twurl/cli.rb', line 377 def ssl? protocol == 'https' end |