Class: ParamsBase
- Inherits:
-
Object
- Object
- ParamsBase
- Defined in:
- lib/models.rb
Direct Known Subclasses
BCSQueryParams, BulkProductLookupParams, BulkProductSearchParams, IndixApiClient, PriceHistoryParams
Instance Method Summary collapse
-
#initialize(params) ⇒ ParamsBase
constructor
A new instance of ParamsBase.
- #to_hash ⇒ Object
Constructor Details
#initialize(params) ⇒ ParamsBase
Returns a new instance of ParamsBase.
2 3 4 |
# File 'lib/models.rb', line 2 def initialize params params.each { |k, v| send "#{k}=", v } end |
Instance Method Details
#to_hash ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/models.rb', line 6 def to_hash hash = {} self.instance_variables.each do |var| hash[var.to_s.delete("@")] = self.instance_variable_get(var) end hash end |