Module: Served::Resource::Attributable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Attribute::Base, Base
- Defined in:
- lib/served/resource/attributable.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#attributes ⇒ Array
The keys for all the defined attributes.
- #initialize(hash = {}) ⇒ Object
Instance Method Details
#attributes ⇒ Array
Returns the keys for all the defined attributes.
55 56 57 |
# File 'lib/served/resource/attributable.rb', line 55 def attributes Hash[self.class.attributes.keys.collect { |name| [name, send(name)] }] end |
#initialize(hash = {}) ⇒ Object
50 51 52 |
# File 'lib/served/resource/attributable.rb', line 50 def initialize(hash = {}) reload_with_attributes(normalize_keys(hash)) end |