Class: Fictium::Document

Inherits:
Model
  • Object
show all
Defined in:
lib/fictium/poros/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#postman

Constructor Details

#initializeDocument

Returns a new instance of Document.



5
6
7
# File 'lib/fictium/poros/document.rb', line 5

def initialize
  @resources = []
end

Instance Attribute Details

#resourcesObject (readonly)

Returns the value of attribute resources.



3
4
5
# File 'lib/fictium/poros/document.rb', line 3

def resources
  @resources
end

Instance Method Details

#create_resourceObject



9
10
11
# File 'lib/fictium/poros/document.rb', line 9

def create_resource
  Fictium::Resource.new(self).tap { |resource| resources << resource }
end

#exportObject



13
14
15
16
17
# File 'lib/fictium/poros/document.rb', line 13

def export
  Fictium.configuration.exporters.each do |exporter|
    exporter.export(self)
  end
end