Class: GOM::Object::CachedBuilder

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

Overview

Build an object out of the given draft using Builder. Uses the object-id mapping for caching the results.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(draft, storage_name) ⇒ CachedBuilder

Returns a new instance of CachedBuilder.



9
10
11
# File 'lib/gom/object/cached_builder.rb', line 9

def initialize(draft, storage_name)
  @draft, @storage_name = draft, storage_name
end

Instance Attribute Details

#draftObject

Returns the value of attribute draft.



6
7
8
# File 'lib/gom/object/cached_builder.rb', line 6

def draft
  @draft
end

#storage_nameObject

Returns the value of attribute storage_name.



7
8
9
# File 'lib/gom/object/cached_builder.rb', line 7

def storage_name
  @storage_name
end

Instance Method Details

#objectObject



13
14
15
16
17
18
19
# File 'lib/gom/object/cached_builder.rb', line 13

def object
  initialize_id
  check_mapping
  build_object
  set_mapping
  @object
end