Class: Taeval::Plagium::Config
- Inherits:
-
Object
- Object
- Taeval::Plagium::Config
- Includes:
- FileHelper
- Defined in:
- lib/taeval/plagium/config.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#max_matches ⇒ Object
readonly
Returns the value of attribute max_matches.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#reject ⇒ Object
readonly
Returns the value of attribute reject.
-
#show_num_matches ⇒ Object
readonly
Returns the value of attribute show_num_matches.
-
#solutions ⇒ Object
readonly
Returns the value of attribute solutions.
Instance Method Summary collapse
-
#initialize(conf_h) ⇒ Config
constructor
A new instance of Config.
Methods included from FileHelper
#create, #exist?, #flatten_include!, #open, #path_of
Constructor Details
#initialize(conf_h) ⇒ Config
Returns a new instance of Config.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/taeval/plagium/config.rb', line 9 def initialize(conf_h) @id = conf_h.fetch('id', '') @language = conf_h.fetch('language', 'ascii') @max_matches = conf_h.fetch('max_matches', 10) @show_num_matches = conf_h.fetch('show_num_matches', 250) @comment = conf_h.fetch('comment', '') output_path = conf_h.fetch('output', '') @output = File.new(path_of(output_path), 'w') @reject = conf_h.fetch('reject', '') @solutions = path_of(conf_h.dig('solution', 'path')) if !File.exist?(@solutions) raise "Plagium: Path of input solutions not exists: #{@solutions}" end end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
7 8 9 |
# File 'lib/taeval/plagium/config.rb', line 7 def comment @comment end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/taeval/plagium/config.rb', line 7 def id @id end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
7 8 9 |
# File 'lib/taeval/plagium/config.rb', line 7 def language @language end |
#max_matches ⇒ Object (readonly)
Returns the value of attribute max_matches.
7 8 9 |
# File 'lib/taeval/plagium/config.rb', line 7 def max_matches @max_matches end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
7 8 9 |
# File 'lib/taeval/plagium/config.rb', line 7 def output @output end |
#reject ⇒ Object (readonly)
Returns the value of attribute reject.
7 8 9 |
# File 'lib/taeval/plagium/config.rb', line 7 def reject @reject end |
#show_num_matches ⇒ Object (readonly)
Returns the value of attribute show_num_matches.
7 8 9 |
# File 'lib/taeval/plagium/config.rb', line 7 def show_num_matches @show_num_matches end |
#solutions ⇒ Object (readonly)
Returns the value of attribute solutions.
7 8 9 |
# File 'lib/taeval/plagium/config.rb', line 7 def solutions @solutions end |