Class: Levelup::Templates::DataParcel
- Inherits:
-
Object
- Object
- Levelup::Templates::DataParcel
- Defined in:
- lib/levelup/templates/data_parcel.rb
Overview
A series of methods used to convert objects to/from hashes.
Direct Known Subclasses
Class Method Summary collapse
-
.excluded?(instance_variable) ⇒ Boolean
Determines if the specified instance variable is excluded from this object’s generated hash.
- .instance_variables_excluded_from_hash ⇒ Object
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ DataParcel
constructor
A new instance of DataParcel.
Constructor Details
#initialize(hash = {}) ⇒ DataParcel
Returns a new instance of DataParcel.
5 6 7 |
# File 'lib/levelup/templates/data_parcel.rb', line 5 def initialize(hash = {}) assign_instance_variables_from_hash hash end |
Class Method Details
.excluded?(instance_variable) ⇒ Boolean
Determines if the specified instance variable is excluded from this object’s generated hash.
11 12 13 |
# File 'lib/levelup/templates/data_parcel.rb', line 11 def self.excluded?(instance_variable) instance_variables_excluded_from_hash.include? instance_variable end |
.instance_variables_excluded_from_hash ⇒ Object
15 16 17 |
# File 'lib/levelup/templates/data_parcel.rb', line 15 def self.instance_variables_excluded_from_hash [:excluded_from_hash] end |