Class: Resulang::App::Processor
- Inherits:
-
Object
- Object
- Resulang::App::Processor
- Defined in:
- lib/resulang/app.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #filename ⇒ Object
-
#initialize(app:, output:, format:) ⇒ Processor
constructor
A new instance of Processor.
- #process ⇒ Object
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
#app ⇒ Object (readonly)
Returns the value of attribute app.
19 20 21 |
# File 'lib/resulang/app.rb', line 19 def app @app end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
19 20 21 |
# File 'lib/resulang/app.rb', line 19 def format @format end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
19 20 21 |
# File 'lib/resulang/app.rb', line 19 def output @output end |
Instance Method Details
#filename ⇒ Object
27 28 29 |
# File 'lib/resulang/app.rb', line 27 def filename File.extname(output) == ".#{format}" ? output : "#{output}.#{format}" end |
#process ⇒ Object
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 |