Class: GOM::Storage::Fetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/gom/storage/fetcher.rb

Overview

Fetches a draft from the storage adapter and uses the cached builder to build an object from it.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ Fetcher

Returns a new instance of Fetcher.



7
8
9
# File 'lib/gom/storage/fetcher.rb', line 7

def initialize(id)
  @id = id
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/gom/storage/fetcher.rb', line 5

def id
  @id
end

Instance Method Details

#objectObject



11
12
13
14
15
16
# File 'lib/gom/storage/fetcher.rb', line 11

def object
  fetch_draft
  return nil unless has_draft?
  build_object
  @object
end