Class: Blinksale::Service
- Inherits:
-
Object
- Object
- Blinksale::Service
- Defined in:
- lib/blinksale.rb
Instance Attribute Summary collapse
-
#clients ⇒ Object
readonly
Returns the value of attribute clients.
-
#invoices ⇒ Object
readonly
Returns the value of attribute invoices.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#rest_resource ⇒ Object
readonly
Returns the value of attribute rest_resource.
-
#subdomain ⇒ Object
readonly
Returns the value of attribute subdomain.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #base_url ⇒ Object
-
#initialize(subdomain, username, password) ⇒ Service
constructor
A new instance of Service.
Constructor Details
#initialize(subdomain, username, password) ⇒ Service
Returns a new instance of Service.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/blinksale.rb', line 10 def initialize(subdomain, username, password) @subdomain = subdomain @username = username @password = password @rest_resource = RestClient::Resource.new(base_url, :user => username, :password => password) @invoices = Blinksale::Invoices.new(self) @clients = Blinksale::Clients.new(self) end |
Instance Attribute Details
#clients ⇒ Object (readonly)
Returns the value of attribute clients.
8 9 10 |
# File 'lib/blinksale.rb', line 8 def clients @clients end |
#invoices ⇒ Object (readonly)
Returns the value of attribute invoices.
8 9 10 |
# File 'lib/blinksale.rb', line 8 def invoices @invoices end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
7 8 9 |
# File 'lib/blinksale.rb', line 7 def password @password end |
#rest_resource ⇒ Object (readonly)
Returns the value of attribute rest_resource.
7 8 9 |
# File 'lib/blinksale.rb', line 7 def rest_resource @rest_resource end |
#subdomain ⇒ Object (readonly)
Returns the value of attribute subdomain.
7 8 9 |
# File 'lib/blinksale.rb', line 7 def subdomain @subdomain end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
7 8 9 |
# File 'lib/blinksale.rb', line 7 def username @username end |
Instance Method Details
#base_url ⇒ Object
23 24 25 |
# File 'lib/blinksale.rb', line 23 def base_url "https://#{ subdomain }.blinksale.com" end |