Class: OpenKit::Request::BaseDelegate
- Inherits:
-
Object
- Object
- OpenKit::Request::BaseDelegate
- Defined in:
- lib/openkit/request/base_delegate.rb
Direct Known Subclasses
DeleteDelegate, GetDelegate, PostDelegate, PostMultipartDelegate, PutDelegate
Instance Attribute Summary collapse
-
#app_key ⇒ Object
readonly
Returns the value of attribute app_key.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
-
#secret_key ⇒ Object
readonly
Returns the value of attribute secret_key.
Instance Method Summary collapse
- #base_uri ⇒ Object
-
#initialize(path) ⇒ BaseDelegate
constructor
A new instance of BaseDelegate.
- #uri ⇒ Object
Constructor Details
#initialize(path) ⇒ BaseDelegate
Returns a new instance of BaseDelegate.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/openkit/request/base_delegate.rb', line 8 def initialize(path) raise "Don't instantiate me!" if abstract_class? raise "OpenKit::Config.host is not set." unless Config.host raise "OpenKit::Config.app_key is not set." unless Config.app_key raise "OpenKit::Config.secret_key is not set." unless Config.secret_key @scheme = Config.skip_https ? "http" : "https" @host = Config.host @app_key = Config.app_key @secret_key = Config.secret_key @path = path end |
Instance Attribute Details
#app_key ⇒ Object (readonly)
Returns the value of attribute app_key.
5 6 7 |
# File 'lib/openkit/request/base_delegate.rb', line 5 def app_key @app_key end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
5 6 7 |
# File 'lib/openkit/request/base_delegate.rb', line 5 def host @host end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/openkit/request/base_delegate.rb', line 6 def path @path end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
5 6 7 |
# File 'lib/openkit/request/base_delegate.rb', line 5 def scheme @scheme end |
#secret_key ⇒ Object (readonly)
Returns the value of attribute secret_key.
5 6 7 |
# File 'lib/openkit/request/base_delegate.rb', line 5 def secret_key @secret_key end |
Instance Method Details
#base_uri ⇒ Object
23 24 25 |
# File 'lib/openkit/request/base_delegate.rb', line 23 def base_uri @scheme + "://" + @host end |
#uri ⇒ Object
27 28 29 |
# File 'lib/openkit/request/base_delegate.rb', line 27 def uri @uri ||= URI(base_uri + @path) end |