Class: Cardflex::Plan

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/cardflex/plan.rb

Defined Under Namespace

Modules: Type

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseModule

included, #method_missing

Methods included from BaseModule::ClassMethods

#create_helper_methods, #set_instance_variables_from_hash, #snakecase

Constructor Details

#initialize(gateway, attributes) ⇒ Plan

Returns a new instance of Plan.



12
13
14
15
16
# File 'lib/cardflex/plan.rb', line 12

def initialize(gateway, attributes)
  @gateway = gateway
  @type = attributes[:action_type]
  set_instance_variables_from_hash(attributes)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Cardflex::BaseModule

Instance Attribute Details

#action_typeObject (readonly)

Returns the value of attribute action_type.



9
10
11
# File 'lib/cardflex/plan.rb', line 9

def action_type
  @action_type
end

#planObject (readonly)

Returns the value of attribute plan.



10
11
12
# File 'lib/cardflex/plan.rb', line 10

def plan
  @plan
end

#resultObject (readonly)

Returns the value of attribute result.



9
10
11
# File 'lib/cardflex/plan.rb', line 9

def result
  @result
end

#result_codeObject (readonly)

Returns the value of attribute result_code.



9
10
11
# File 'lib/cardflex/plan.rb', line 9

def result_code
  @result_code
end

#result_textObject (readonly)

Returns the value of attribute result_text.



9
10
11
# File 'lib/cardflex/plan.rb', line 9

def result_text
  @result_text
end

Class Method Details

.create(attributes) ⇒ Object



18
19
20
# File 'lib/cardflex/plan.rb', line 18

def self.create(attributes)
  Configuration.gateway.plan.request(:add_plan => attributes)
end