Class: GOM::Object::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/gom/object/builder.rb

Overview

Build an object out of the given draft.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(draft, object = nil) ⇒ Builder

Returns a new instance of Builder.



8
9
10
# File 'lib/gom/object/builder.rb', line 8

def initialize(draft, object = nil)
  @draft, @object = draft, object
end

Instance Attribute Details

#draftObject

Returns the value of attribute draft.



5
6
7
# File 'lib/gom/object/builder.rb', line 5

def draft
  @draft
end

#objectObject



12
13
14
15
16
17
# File 'lib/gom/object/builder.rb', line 12

def object
  initialize_object unless @object
  set_properties
  set_relations
  @object
end