Class: AtCoderFriends::Context
- Inherits:
-
Object
- Object
- AtCoderFriends::Context
- Defined in:
- lib/at_coder_friends/context.rb
Overview
Holds applicaion global information
-
command line options
-
target path
-
configuration
-
application modules
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #config ⇒ Object
- #emitter ⇒ Object
-
#initialize(options, path) ⇒ Context
constructor
A new instance of Context.
- #judge_test_runner ⇒ Object
- #post_process ⇒ Object
- #sample_test_runner ⇒ Object
- #scraping_agent ⇒ Object
- #verifier ⇒ Object
Constructor Details
#initialize(options, path) ⇒ Context
Returns a new instance of Context.
12 13 14 15 |
# File 'lib/at_coder_friends/context.rb', line 12 def initialize(, path) = @path = File.(path) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/at_coder_friends/context.rb', line 10 def end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/at_coder_friends/context.rb', line 10 def path @path end |
Instance Method Details
#config ⇒ Object
17 18 19 |
# File 'lib/at_coder_friends/context.rb', line 17 def config @config ||= ConfigLoader.load_config(self) end |
#emitter ⇒ Object
37 38 39 |
# File 'lib/at_coder_friends/context.rb', line 37 def emitter @emitter ||= Emitter.new(self) end |
#judge_test_runner ⇒ Object
29 30 31 |
# File 'lib/at_coder_friends/context.rb', line 29 def judge_test_runner @judge_test_runner ||= TestRunner::Judge.new(self) end |
#post_process ⇒ Object
41 42 43 |
# File 'lib/at_coder_friends/context.rb', line 41 def post_process @scraping_agent&.save_session end |
#sample_test_runner ⇒ Object
25 26 27 |
# File 'lib/at_coder_friends/context.rb', line 25 def sample_test_runner @sample_test_runner ||= TestRunner::Sample.new(self) end |
#scraping_agent ⇒ Object
21 22 23 |
# File 'lib/at_coder_friends/context.rb', line 21 def scraping_agent @scraping_agent ||= Scraping::Agent.new(self) end |
#verifier ⇒ Object
33 34 35 |
# File 'lib/at_coder_friends/context.rb', line 33 def verifier @verifier ||= Verifier.new(self) end |