Module: Blueprints::Blueprintable

Included in:
Saveable
Defined in:
lib/blueprints/core_ext.rb

Overview

Include this module into your class if you need klass.blueprint and object.blueprint methods.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(mod) ⇒ Object



42
43
44
# File 'lib/blueprints/core_ext.rb', line 42

def self.included(mod)
  mod.extend Blueprints::Blueprintable::ClassMethods
end

Instance Method Details

#blueprint(attributes) ⇒ Object

Updates attributes of object by calling setter methods.



47
48
49
50
51
# File 'lib/blueprints/core_ext.rb', line 47

def blueprint(attributes)
  Blueprints::Blueprint.normalize_attributes(attributes).each do |attr, val|
    send(:"#{attr}=", val)
  end
end