Class: SVGGVS::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/svggvs/session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSession

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_backObject

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_pathObject

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_sizeObject

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_dpiObject

Returns the value of attribute pdf_dpi.



4
5
6
# File 'lib/svggvs/session.rb', line 4

def pdf_dpi
  @pdf_dpi
end

#pdf_targetObject

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_widthObject

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_pathObject

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_targetObject

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_sourceObject

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

Yields:

  • (_self)

Yield Parameters:



11
12
13
# File 'lib/svggvs/session.rb', line 11

def configure
  yield self
end

#fileObject



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

#runObject



33
34
35
# File 'lib/svggvs/session.rb', line 33

def run
  @process.call
end

#with_new_targetObject



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