Class: Resulang::App::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/resulang/app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app:, output:, format:) ⇒ Processor

Returns a new instance of Processor.



21
22
23
24
25
# File 'lib/resulang/app.rb', line 21

def initialize(app:, output:, format:)
  @app    = app
  @output = output
  @format = format
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



19
20
21
# File 'lib/resulang/app.rb', line 19

def app
  @app
end

#formatObject (readonly)

Returns the value of attribute format.



19
20
21
# File 'lib/resulang/app.rb', line 19

def format
  @format
end

#outputObject (readonly)

Returns the value of attribute output.



19
20
21
# File 'lib/resulang/app.rb', line 19

def output
  @output
end

Instance Method Details

#filenameObject



27
28
29
# File 'lib/resulang/app.rb', line 27

def filename
  File.extname(output) == ".#{format}" ? output : "#{output}.#{format}"
end

#processObject



31
32
33
34
35
# File 'lib/resulang/app.rb', line 31

def process
  case format.to_sym
    when :html then process_html
  end
end