Class: Djoini::Fields
- Inherits:
-
Object
- Object
- Djoini::Fields
- Defined in:
- lib/djoini/fields.rb
Overview
Holds all fields and values in rowobject
Instance Method Summary collapse
- #clone_hash ⇒ Object
-
#initialize(params) ⇒ Fields
constructor
A new instance of Fields.
Constructor Details
#initialize(params) ⇒ Fields
Returns a new instance of Fields.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/djoini/fields.rb', line 4 def initialize(params) self.data = {} attributes = params.fetch(:attributes) values = params.fetch(:values, {}) attributes.each { |name| data[name] = values[name.to_s] } build_accessors(attributes) end |
Instance Method Details
#clone_hash ⇒ Object
15 16 17 |
# File 'lib/djoini/fields.rb', line 15 def clone_hash data.clone end |