Class: Dsl::Graph::ExportGraph
- Inherits:
-
Object
- Object
- Dsl::Graph::ExportGraph
- Defined in:
- lib/dsl/graph/export.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(graph, filename) ⇒ ExportGraph
constructor
A new instance of ExportGraph.
Constructor Details
#initialize(graph, filename) ⇒ ExportGraph
Returns a new instance of ExportGraph.
7 8 9 10 |
# File 'lib/dsl/graph/export.rb', line 7 def initialize(graph, filename) @graph = graph @filename = filename end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/dsl/graph/export.rb', line 12 def call ext = File.extname(@filename.downcase) case ext when ".pdf" export_to_pdf when ".yaml", ".yml" export_to_yaml else warn "[ERROR] Unkown export format: (#{ext})" exit 1 end end |