Class: CentrumFaktur::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/centrum_faktur/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration = {}) ⇒ Client

Returns a new instance of Client.



5
6
7
8
9
# File 'lib/centrum_faktur/client.rb', line 5

def initialize(configuration = {})
  @login     = configuration[:login]     || raise(ArgumentError.new("You must specify login"))
  @password  = configuration[:password]  || raise(ArgumentError.new("You must specify password"))
  @subdomain = configuration[:subdomain] || raise(ArgumentError.new("You must specify subdomain"))
end

Instance Attribute Details

#loginObject (readonly)

Returns the value of attribute login.



3
4
5
# File 'lib/centrum_faktur/client.rb', line 3

def 
  @login
end

#passwordObject (readonly)

Returns the value of attribute password.



3
4
5
# File 'lib/centrum_faktur/client.rb', line 3

def password
  @password
end

#subdomainObject (readonly)

Returns the value of attribute subdomain.



3
4
5
# File 'lib/centrum_faktur/client.rb', line 3

def subdomain
  @subdomain
end

Instance Method Details

#accountObject



11
12
13
# File 'lib/centrum_faktur/client.rb', line 11

def 
  API::Account.new(self)
end

#commentObject



15
16
17
# File 'lib/centrum_faktur/client.rb', line 15

def comment
  API::Comment.new(self)
end

#customerObject



19
20
21
# File 'lib/centrum_faktur/client.rb', line 19

def customer
  API::Customer.new(self)
end

#estimateObject



23
24
25
# File 'lib/centrum_faktur/client.rb', line 23

def estimate
  API::Estimate.new(self)
end

#invoiceObject



27
28
29
# File 'lib/centrum_faktur/client.rb', line 27

def invoice
  API::Invoice.new(self)
end

#paymentObject



31
32
33
# File 'lib/centrum_faktur/client.rb', line 31

def payment
  API::Payment.new(self)
end

#userObject



35
36
37
# File 'lib/centrum_faktur/client.rb', line 35

def user
  API::User.new(self)
end