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
- #request_method ⇒ Object
- #ssl? ⇒ Boolean
Instance Method Details
#base_url ⇒ Object
234 235 236 |
# File 'lib/twurl/cli.rb', line 234 def base_url "#{protocol}://#{host}" end |
#debug_output_io ⇒ Object
242 243 244 |
# File 'lib/twurl/cli.rb', line 242 def debug_output_io super || STDERR end |
#host ⇒ Object
254 255 256 |
# File 'lib/twurl/cli.rb', line 254 def host super || DEFAULT_HOST end |
#oauth_client_options ⇒ Object
227 228 229 230 231 232 |
# File 'lib/twurl/cli.rb', line 227 def OAuthClient::OAUTH_CLIENT_OPTIONS.inject({}) do |, option| [option] = send(option) end end |
#protocol ⇒ Object
250 251 252 |
# File 'lib/twurl/cli.rb', line 250 def protocol super || DEFAULT_PROTOCOL end |
#request_method ⇒ Object
246 247 248 |
# File 'lib/twurl/cli.rb', line 246 def request_method super || (data.empty? ? DEFAULT_REQUEST_METHOD : 'post') end |
#ssl? ⇒ Boolean
238 239 240 |
# File 'lib/twurl/cli.rb', line 238 def ssl? protocol == 'https' end |