Class: TinyClient::Configuration Abstract
- Inherits:
-
Object
- Object
- TinyClient::Configuration
- Includes:
- Singleton
- Defined in:
- lib/tiny_client/configuration.rb
Overview
This class is abstract.
Provides the default client configuration Subclass and override #initialize to implement a client confiuration.
Instance Attribute Summary collapse
-
#limit ⇒ Integer
readonly
default limit used as a query param.
-
#url ⇒ String
readonly
the api root url (i.e: localhost/api/1.0).
Instance Method Summary collapse
-
#connect_timeout ⇒ Integer
Request connection timeout in seconds.
-
#headers ⇒ Hash
Headers default headers you want to pass along every request.
- #initialize ⇒ Configuration constructor
- #requestor ⇒ Object
-
#verbose ⇒ Boolean
True if curl verbose option is set.
Constructor Details
#initialize ⇒ Configuration
12 13 14 |
# File 'lib/tiny_client/configuration.rb', line 12 def initialize raise NotImplementedError end |
Instance Attribute Details
#limit ⇒ Integer (readonly)
default limit used as a query param
7 8 9 |
# File 'lib/tiny_client/configuration.rb', line 7 def limit @limit end |
#url ⇒ String (readonly)
the api root url (i.e: localhost/api/1.0)
7 8 9 |
# File 'lib/tiny_client/configuration.rb', line 7 def url @url end |
Instance Method Details
#connect_timeout ⇒ Integer
Returns request connection timeout in seconds
17 18 19 |
# File 'lib/tiny_client/configuration.rb', line 17 def connect_timeout @connect_timeout ||= 30 end |
#headers ⇒ Hash
Returns headers default headers you want to pass along every request
22 23 24 |
# File 'lib/tiny_client/configuration.rb', line 22 def headers @headers ||= {} end |
#requestor ⇒ Object
32 33 34 |
# File 'lib/tiny_client/configuration.rb', line 32 def requestor @requestor ||= TinyClient::RemoteClient.new(self) end |
#verbose ⇒ Boolean
Returns true if curl verbose option is set
27 28 29 30 |
# File 'lib/tiny_client/configuration.rb', line 27 def verbose @verbose = false if @verbose.nil? @verbose end |