Class: AtCoderFriends::Problem
- Inherits:
-
Object
- Object
- AtCoderFriends::Problem
- Defined in:
- lib/at_coder_friends/problem.rb
Overview
holds problem information
Instance Attribute Summary collapse
-
#defs ⇒ Object
Returns the value of attribute defs.
-
#desc ⇒ Object
Returns the value of attribute desc.
-
#fmt ⇒ Object
Returns the value of attribute fmt.
-
#html ⇒ Object
Returns the value of attribute html.
-
#q ⇒ Object
readonly
Returns the value of attribute q.
-
#smps ⇒ Object
readonly
Returns the value of attribute smps.
-
#srcs ⇒ Object
readonly
Returns the value of attribute srcs.
Instance Method Summary collapse
- #add_smp(no, ext, txt) ⇒ Object
- #add_src(ext, txt) ⇒ Object
-
#initialize(q) {|_self| ... } ⇒ Problem
constructor
A new instance of Problem.
Constructor Details
#initialize(q) {|_self| ... } ⇒ Problem
Returns a new instance of Problem.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/at_coder_friends/problem.rb', line 25 def initialize(q) @q = q @html = '' @desc = '' @fmt = '' @smps = [] @defs = [] @srcs = [] yield self if block_given? end |
Instance Attribute Details
#defs ⇒ Object
Returns the value of attribute defs.
23 24 25 |
# File 'lib/at_coder_friends/problem.rb', line 23 def defs @defs end |
#desc ⇒ Object
Returns the value of attribute desc.
23 24 25 |
# File 'lib/at_coder_friends/problem.rb', line 23 def desc @desc end |
#fmt ⇒ Object
Returns the value of attribute fmt.
22 23 24 |
# File 'lib/at_coder_friends/problem.rb', line 22 def fmt @fmt end |
#html ⇒ Object
Returns the value of attribute html.
23 24 25 |
# File 'lib/at_coder_friends/problem.rb', line 23 def html @html end |
#q ⇒ Object (readonly)
Returns the value of attribute q.
22 23 24 |
# File 'lib/at_coder_friends/problem.rb', line 22 def q @q end |
#smps ⇒ Object (readonly)
Returns the value of attribute smps.
22 23 24 |
# File 'lib/at_coder_friends/problem.rb', line 22 def smps @smps end |
#srcs ⇒ Object (readonly)
Returns the value of attribute srcs.
22 23 24 |
# File 'lib/at_coder_friends/problem.rb', line 22 def srcs @srcs end |
Instance Method Details
#add_smp(no, ext, txt) ⇒ Object
40 41 42 |
# File 'lib/at_coder_friends/problem.rb', line 40 def add_smp(no, ext, txt) @smps << DataSample.new(no, ext, txt) end |
#add_src(ext, txt) ⇒ Object
44 45 46 |
# File 'lib/at_coder_friends/problem.rb', line 44 def add_src(ext, txt) @srcs << SourceSample.new(ext, txt) end |