Class: MastercardCoreSdk::Core::QueryParams
- Inherits:
-
Object
- Object
- MastercardCoreSdk::Core::QueryParams
- Defined in:
- lib/mastercard_core_sdk/core/query_params.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #add(key, value) ⇒ Object
-
#initialize ⇒ QueryParams
constructor
A new instance of QueryParams.
Constructor Details
#initialize ⇒ QueryParams
Returns a new instance of QueryParams.
7 8 9 |
# File 'lib/mastercard_core_sdk/core/query_params.rb', line 7 def initialize @params = {} end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/mastercard_core_sdk/core/query_params.rb', line 5 def params @params end |
Instance Method Details
#add(key, value) ⇒ Object
11 12 13 14 15 |
# File 'lib/mastercard_core_sdk/core/query_params.rb', line 11 def add(key, value) key = key.to_sym if key.is_a?(String) @params.merge!({ key => value }) return self end |