Class: Viaduct::API::Client
- Inherits:
-
Object
- Object
- Viaduct::API::Client
- Defined in:
- lib/viaduct/api/client.rb
Instance Attribute Summary collapse
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #controller(*args) ⇒ Object
-
#initialize(token = nil, secret = nil) ⇒ Client
constructor
A new instance of Client.
- #method_missing(name, value = nil) ⇒ Object
- #push ⇒ Object
- #request(*args) ⇒ Object
Constructor Details
#initialize(token = nil, secret = nil) ⇒ Client
Returns a new instance of Client.
11 12 13 |
# File 'lib/viaduct/api/client.rb', line 11 def initialize(token = nil, secret = nil) @token, @secret = token, secret end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, value = nil) ⇒ Object
35 36 37 |
# File 'lib/viaduct/api/client.rb', line 35 def method_missing(name, value = nil) value.nil? ? controller(name) : super end |
Instance Attribute Details
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
9 10 11 |
# File 'lib/viaduct/api/client.rb', line 9 def secret @secret end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
8 9 10 |
# File 'lib/viaduct/api/client.rb', line 8 def token @token end |
Instance Method Details
#controller(*args) ⇒ Object
19 20 21 |
# File 'lib/viaduct/api/client.rb', line 19 def controller(*args) moonrope.controller(*args) end |
#push ⇒ Object
23 24 25 |
# File 'lib/viaduct/api/client.rb', line 23 def push @push_client ||= PushClient.new(self) end |
#request(*args) ⇒ Object
15 16 17 |
# File 'lib/viaduct/api/client.rb', line 15 def request(*args) moonrope.request(*args) end |