Module: Representable::ClassMethods

Defined in:
lib/representable.rb

Defined Under Namespace

Modules: Declarations

Instance Method Summary collapse

Instance Method Details

#create_represented(document, *args) ⇒ Object

Create and yield object and options. Called in .from_json and friends.



88
89
90
91
92
# File 'lib/representable.rb', line 88

def create_represented(document, *args)
  new.tap do |represented|
    yield represented, *args if block_given?
  end
end

#prepare(represented) ⇒ Object



94
95
96
# File 'lib/representable.rb', line 94

def prepare(represented)
  represented.extend(self)  # was: PrepareStrategy::Extend.
end