Class: Simplifyapi::Representation

Inherits:
Object
  • Object
show all
Defined in:
lib/simplifyapi/representation.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Representation

Returns a new instance of Representation.



7
8
9
10
# File 'lib/simplifyapi/representation.rb', line 7

def initialize &block
  @builder = Builder.new &block
  @importer = Importer.new &block
end

Instance Method Details

#export(representer, model) ⇒ Object



12
13
14
# File 'lib/simplifyapi/representation.rb', line 12

def export representer, model
  @builder.export representer, model
end

#import(representer, model, hash) ⇒ Object



16
17
18
19
20
# File 'lib/simplifyapi/representation.rb', line 16

def import representer, model, hash
  @importer.import representer, model, hash

  model
end