Module: Cardflex::BaseModule

Includes:
ClassMethods
Included in:
CustomerVault, ErrorResponse, Plan, Subscription, SuccessResponse, ThreeStep, Transaction
Defined in:
lib/cardflex/base_module.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ClassMethods

#create_helper_methods, #set_instance_variables_from_hash, #snakecase

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object

add support for merchant_defined_field_#



33
34
35
36
37
38
39
# File 'lib/cardflex/base_module.rb', line 33

def method_missing(method, *args)
  if method =~ /^merchant_defined_field_\d+$/
    instance_variable_get("@#{method}")
  else
    super
  end
end

Class Method Details

.included(base) ⇒ Object



28
29
30
# File 'lib/cardflex/base_module.rb', line 28

def self.included(base)
  base.extend(self)
end