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
304 305 306 |
# File 'lib/twurl/cli.rb', line 304 def base_url "#{protocol}://#{host}" end |
#debug_output_io ⇒ Object
312 313 314 |
# File 'lib/twurl/cli.rb', line 312 def debug_output_io super || STDERR end |
#host ⇒ Object
324 325 326 |
# File 'lib/twurl/cli.rb', line 324 def host super || DEFAULT_HOST end |
#oauth_client_options ⇒ Object
297 298 299 300 301 302 |
# File 'lib/twurl/cli.rb', line 297 def OAuthClient::OAUTH_CLIENT_OPTIONS.inject({}) do |, option| [option] = send(option) end end |
#protocol ⇒ Object
320 321 322 |
# File 'lib/twurl/cli.rb', line 320 def protocol super || DEFAULT_PROTOCOL end |
#proxy ⇒ Object
328 329 330 |
# File 'lib/twurl/cli.rb', line 328 def proxy super || nil end |
#request_method ⇒ Object
316 317 318 |
# File 'lib/twurl/cli.rb', line 316 def request_method super || (data.empty? ? DEFAULT_REQUEST_METHOD : 'post') end |
#ssl? ⇒ Boolean
308 309 310 |
# File 'lib/twurl/cli.rb', line 308 def ssl? protocol == 'https' end |