Class: AtCoderFriends::Problem

Inherits:
Object
  • Object
show all
Defined in:
lib/at_coder_friends/problem.rb

Overview

holds problem information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(q) {|_self| ... } ⇒ Problem

Returns a new instance of Problem.

Yields:

  • (_self)

Yield Parameters:



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

#defsObject

Returns the value of attribute defs.



23
24
25
# File 'lib/at_coder_friends/problem.rb', line 23

def defs
  @defs
end

#descObject

Returns the value of attribute desc.



23
24
25
# File 'lib/at_coder_friends/problem.rb', line 23

def desc
  @desc
end

#fmtObject

Returns the value of attribute fmt.



22
23
24
# File 'lib/at_coder_friends/problem.rb', line 22

def fmt
  @fmt
end

#htmlObject

Returns the value of attribute html.



23
24
25
# File 'lib/at_coder_friends/problem.rb', line 23

def html
  @html
end

#qObject (readonly)

Returns the value of attribute q.



22
23
24
# File 'lib/at_coder_friends/problem.rb', line 22

def q
  @q
end

#smpsObject (readonly)

Returns the value of attribute smps.



22
23
24
# File 'lib/at_coder_friends/problem.rb', line 22

def smps
  @smps
end

#srcsObject (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