Class: Einvoice::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider) ⇒ Client

Returns a new instance of Client.



5
6
7
# File 'lib/einvoice/client.rb', line 5

def initialize(provider)
  @provider = provider
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/einvoice/client.rb', line 9

def method_missing(m, *args, &block)
  if provider.respond_to?(m)
    provider.public_send(m, *args, &block)
  else
    super
  end
end

Instance Attribute Details

#providerObject

Returns the value of attribute provider.



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

def provider
  @provider
end

Instance Method Details

#respond_to_missing?(m, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/einvoice/client.rb', line 17

def respond_to_missing?(m, include_private = false)
  provider.respond_to?(m) || super
end