Class: SVGGVS::Session
- Inherits:
-
Object
- Object
- SVGGVS::Session
- Defined in:
- lib/svggvs/session.rb
Instance Attribute Summary collapse
-
#card_back ⇒ Object
Returns the value of attribute card_back.
-
#individual_files_path ⇒ Object
Returns the value of attribute individual_files_path.
-
#on_card_finished(&block) ⇒ Object
Returns the value of attribute on_card_finished.
-
#pdf_card_size ⇒ Object
Returns the value of attribute pdf_card_size.
-
#pdf_dpi ⇒ Object
Returns the value of attribute pdf_dpi.
-
#pdf_target ⇒ Object
Returns the value of attribute pdf_target.
-
#png_export_width ⇒ Object
Returns the value of attribute png_export_width.
-
#png_files_path ⇒ Object
Returns the value of attribute png_files_path.
-
#svg_merged_target ⇒ Object
Returns the value of attribute svg_merged_target.
-
#svg_source ⇒ Object
Returns the value of attribute svg_source.
Instance Method Summary collapse
- #card_finished! ⇒ Object
- #configure {|_self| ... } ⇒ Object
- #file ⇒ Object
-
#initialize ⇒ Session
constructor
A new instance of Session.
- #process(&block) ⇒ Object
- #run ⇒ Object
- #with_new_target ⇒ Object
Constructor Details
#initialize ⇒ Session
Returns a new instance of Session.
7 8 9 |
# File 'lib/svggvs/session.rb', line 7 def initialize @index = 0 end |
Instance Attribute Details
#card_back ⇒ Object
Returns the value of attribute card_back.
5 6 7 |
# File 'lib/svggvs/session.rb', line 5 def card_back @card_back end |
#individual_files_path ⇒ Object
Returns the value of attribute individual_files_path.
3 4 5 |
# File 'lib/svggvs/session.rb', line 3 def individual_files_path @individual_files_path end |
#on_card_finished(&block) ⇒ Object
Returns the value of attribute on_card_finished.
3 4 5 |
# File 'lib/svggvs/session.rb', line 3 def on_card_finished @on_card_finished end |
#pdf_card_size ⇒ Object
Returns the value of attribute pdf_card_size.
4 5 6 |
# File 'lib/svggvs/session.rb', line 4 def pdf_card_size @pdf_card_size end |
#pdf_dpi ⇒ Object
Returns the value of attribute pdf_dpi.
4 5 6 |
# File 'lib/svggvs/session.rb', line 4 def pdf_dpi @pdf_dpi end |
#pdf_target ⇒ Object
Returns the value of attribute pdf_target.
5 6 7 |
# File 'lib/svggvs/session.rb', line 5 def pdf_target @pdf_target end |
#png_export_width ⇒ Object
Returns the value of attribute png_export_width.
4 5 6 |
# File 'lib/svggvs/session.rb', line 4 def png_export_width @png_export_width end |
#png_files_path ⇒ Object
Returns the value of attribute png_files_path.
4 5 6 |
# File 'lib/svggvs/session.rb', line 4 def png_files_path @png_files_path end |
#svg_merged_target ⇒ Object
Returns the value of attribute svg_merged_target.
3 4 5 |
# File 'lib/svggvs/session.rb', line 3 def svg_merged_target @svg_merged_target end |
#svg_source ⇒ Object
Returns the value of attribute svg_source.
3 4 5 |
# File 'lib/svggvs/session.rb', line 3 def svg_source @svg_source end |
Instance Method Details
#card_finished! ⇒ Object
19 20 21 22 23 |
# File 'lib/svggvs/session.rb', line 19 def card_finished! @on_card_finished.call(@index) if @on_card_finished @index += 1 end |
#configure {|_self| ... } ⇒ Object
11 12 13 |
# File 'lib/svggvs/session.rb', line 11 def configure yield self end |
#file ⇒ Object
29 30 31 |
# File 'lib/svggvs/session.rb', line 29 def file @file ||= SVGGVS::File.new(@svg_source) end |
#process(&block) ⇒ Object
15 16 17 |
# File 'lib/svggvs/session.rb', line 15 def process(&block) @process = block end |
#run ⇒ Object
33 34 35 |
# File 'lib/svggvs/session.rb', line 33 def run @process.call end |
#with_new_target ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/svggvs/session.rb', line 37 def with_new_target file.with_new_target do |target| yield target end card_finished! end |