Class: Mastercard::Common::OAuthParameters

Inherits:
Object
  • Object
show all
Defined in:
lib/mastercard_api/common/oauth_parameters.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOAuthParameters

Returns a new instance of OAuthParameters.



8
9
10
# File 'lib/mastercard_api/common/oauth_parameters.rb', line 8

def initialize()
   self.params = Hash.new
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



6
7
8
# File 'lib/mastercard_api/common/oauth_parameters.rb', line 6

def params
  @params
end

Instance Method Details

#add_parameter(key, value) ⇒ Object

add a parameter to the hash and as an instance variable to the class



13
14
15
16
17
18
# File 'lib/mastercard_api/common/oauth_parameters.rb', line 13

def add_parameter(key, value)
   self.params[key.to_sym] = value
   self.class.send(:define_method, key) do
     value
   end
end