Class: Levelup::Templates::DataParcel

Inherits:
Object
  • Object
show all
Defined in:
lib/levelup/templates/data_parcel.rb

Overview

A series of methods used to convert objects to/from hashes.

Direct Known Subclasses

Requests::Base, Responses::Error

Class Method Summary collapse

Instance Method Summary collapse

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.

Returns:

  • (Boolean)


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_hashObject



15
16
17
# File 'lib/levelup/templates/data_parcel.rb', line 15

def self.instance_variables_excluded_from_hash
  [:excluded_from_hash]
end