Class: BupBupRB::Client
- Inherits:
-
Object
- Object
- BupBupRB::Client
- Includes:
- Singleton
- Defined in:
- lib/bup_bup_rb/client.rb
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Class Method Summary collapse
Instance Method Summary collapse
- #access_token ⇒ Object
- #device ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #notification ⇒ Object
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
17 18 19 20 21 22 23 24 25 |
# File 'lib/bup_bup_rb/client.rb', line 17 def initialize @config ||= Configuration.instance @connection = ::Faraday.new(:url => @config.url) do |faraday| faraday.request :url_encoded faraday.response :logger faraday.adapter Faraday.default_adapter end end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
11 12 13 |
# File 'lib/bup_bup_rb/client.rb', line 11 def config @config end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
11 12 13 |
# File 'lib/bup_bup_rb/client.rb', line 11 def connection @connection end |
Class Method Details
.configure {|Configuration.instance| ... } ⇒ Object
13 14 15 |
# File 'lib/bup_bup_rb/client.rb', line 13 def self.configure yield(Configuration.instance) if block_given? end |
.connection ⇒ Object
27 28 29 |
# File 'lib/bup_bup_rb/client.rb', line 27 def self.connection instance.connection end |
Instance Method Details
#access_token ⇒ Object
31 32 33 |
# File 'lib/bup_bup_rb/client.rb', line 31 def access_token BupBupRB::Resource::AccessToken end |
#device ⇒ Object
35 36 37 |
# File 'lib/bup_bup_rb/client.rb', line 35 def device BupBupRB::Resource::Device end |
#notification ⇒ Object
39 40 41 |
# File 'lib/bup_bup_rb/client.rb', line 39 def notification BupBupRB::Resource::Notification end |