Module: Anima::Builder::Methods

Defined in:
lib/anima/builder.rb

Overview

Static instance methods for anima infected classes

Instance Method Summary collapse

Instance Method Details

#initialize(attributes) ⇒ undefined

Initialize an anima infected object

Parameters:

  • attributes (#to_h)

    a hash that matches anima defined attributes

Returns:

  • (undefined)


18
19
20
# File 'lib/anima/builder.rb', line 18

def initialize(attributes)
  self.class.anima.initialize_instance(self, attributes)
end

#to_hHash

Return a hash representation of an anima infected object

Returns:

  • (Hash)


27
28
29
# File 'lib/anima/builder.rb', line 27

def to_h
  self.class.anima.attributes_hash(self)
end