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
Instance Method Details
#base_url ⇒ Object
368 369 370 |
# File 'lib/twurl/cli.rb', line 368 def base_url "#{protocol}://#{host}" end |
#debug_output_io ⇒ Object
372 373 374 |
# File 'lib/twurl/cli.rb', line 372 def debug_output_io super || STDERR end |
#host ⇒ Object
384 385 386 |
# File 'lib/twurl/cli.rb', line 384 def host super || DEFAULT_HOST end |
#oauth_client_options ⇒ Object
361 362 363 364 365 366 |
# File 'lib/twurl/cli.rb', line 361 def OAuthClient::OAUTH_CLIENT_OPTIONS.inject({}) do |, option| [option] = send(option) end end |
#protocol ⇒ Object
380 381 382 |
# File 'lib/twurl/cli.rb', line 380 def protocol super || DEFAULT_PROTOCOL end |
#proxy ⇒ Object
388 389 390 |
# File 'lib/twurl/cli.rb', line 388 def proxy super || nil end |
#request_method ⇒ Object
376 377 378 |
# File 'lib/twurl/cli.rb', line 376 def request_method super || (data.empty? ? DEFAULT_REQUEST_METHOD : 'post') end |