Class: Contest
- Inherits:
-
Object
- Object
- Contest
- Defined in:
- lib/atcoder_tools/contest.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #create! ⇒ Object
-
#initialize(name) ⇒ Contest
constructor
A new instance of Contest.
- #url(task_name) ⇒ Object
Constructor Details
#initialize(name) ⇒ Contest
Returns a new instance of Contest.
10 11 12 |
# File 'lib/atcoder_tools/contest.rb', line 10 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/atcoder_tools/contest.rb', line 8 def name @name end |
Instance Method Details
#create! ⇒ Object
18 19 20 21 22 |
# File 'lib/atcoder_tools/contest.rb', line 18 def create! FileUtils.mkdir_p @name tasks = ['a','b','c','d','e','f'].map{|task_name| Task.new(self, task_name)} tasks.map(&:create!) end |
#url(task_name) ⇒ Object
14 15 16 |
# File 'lib/atcoder_tools/contest.rb', line 14 def url(task_name) "https://atcoder.jp/contests/#{@name}/tasks/#{@name}_#{task_name}" end |