Class: LocalBitcoins::Client
- Inherits:
-
Object
- Object
- LocalBitcoins::Client
- Defined in:
- lib/localbitcoins/client.rb
Constant Summary
Constants included from Request
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#oauth_client ⇒ Object
readonly
Returns the value of attribute oauth_client.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
Initialize a LocalBitcoins::Client instance.
Methods included from Ads
Methods included from Escrows
Constructor Details
#initialize(options = {}) ⇒ Client
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/localbitcoins/client.rb', line 19 def initialize(={}) unless .kind_of?(Hash) raise ArgumentError, "Options hash required." end @oauth_client = OAuth2::Client.new( [:client_id], [:client_secret], authorize_url: "/oauth2/authorize", token_url: "/oauth2/access_token", site: "https://www.localbitcoins.com" ) @access_token = OAuth2::AccessToken.new( oauth_client, [:oauth_token] ) end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
11 12 13 |
# File 'lib/localbitcoins/client.rb', line 11 def access_token @access_token end |
#oauth_client ⇒ Object (readonly)
Returns the value of attribute oauth_client.
11 12 13 |
# File 'lib/localbitcoins/client.rb', line 11 def oauth_client @oauth_client end |