Class: Yorinter::PrintableDocument

Inherits:
Object
  • Object
show all
Includes:
Printable
Defined in:
lib/yorinter/printable_document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Printable

#print

Constructor Details

#initialize(params = {}) ⇒ PrintableDocument

Returns a new instance of PrintableDocument.



5
6
7
8
9
10
11
# File 'lib/yorinter/printable_document.rb', line 5

def initialize params = {}
  [:name, :code, :version, :template, :helper, :style,
    :model, :model_endpoint, :binding_object,
    :input_format, :output_format, :options].each do |field|
    send("#{field}=".to_sym, params[field]) if params[field]
  end
end

Instance Attribute Details

#binding_objectObject

Returns the value of attribute binding_object.



28
29
30
# File 'lib/yorinter/printable_document.rb', line 28

def binding_object
  @binding_object
end

#codeObject

Returns the value of attribute code.



18
19
20
# File 'lib/yorinter/printable_document.rb', line 18

def code
  @code
end

#helperObject

Returns the value of attribute helper.



21
22
23
# File 'lib/yorinter/printable_document.rb', line 21

def helper
  @helper
end

#input_formatObject

Returns the value of attribute input_format.



25
26
27
# File 'lib/yorinter/printable_document.rb', line 25

def input_format
  @input_format
end

#modelObject

Returns the value of attribute model.



23
24
25
# File 'lib/yorinter/printable_document.rb', line 23

def model
  @model
end

#model_endpointObject

Returns the value of attribute model_endpoint.



24
25
26
# File 'lib/yorinter/printable_document.rb', line 24

def model_endpoint
  @model_endpoint
end

#nameObject

Returns the value of attribute name.



17
18
19
# File 'lib/yorinter/printable_document.rb', line 17

def name
  @name
end

#optionsObject

Returns the value of attribute options.



27
28
29
# File 'lib/yorinter/printable_document.rb', line 27

def options
  @options
end

#output_formatObject

Returns the value of attribute output_format.



26
27
28
# File 'lib/yorinter/printable_document.rb', line 26

def output_format
  @output_format
end

#styleObject

Returns the value of attribute style.



22
23
24
# File 'lib/yorinter/printable_document.rb', line 22

def style
  @style
end

#templateObject

Returns the value of attribute template.



20
21
22
# File 'lib/yorinter/printable_document.rb', line 20

def template
  @template
end

#versionObject

Returns the value of attribute version.



19
20
21
# File 'lib/yorinter/printable_document.rb', line 19

def version
  @version
end

Instance Method Details

#render(engine, params = {}, options = {}) ⇒ Object



13
14
15
# File 'lib/yorinter/printable_document.rb', line 13

def render engine, params = {}, options = {}
  engine.new(self, params, options).render
end