class AtCoderFriends::Problem

holds problem information

Constants

Constant
Options
SECTION_CONSTRAINTS
SECTION_INTRO
SECTION_IN_FMT
SECTION_IN_SMP
SECTION_IN_SMP_PAT
SECTION_IO_FMT
SECTION_IO_SMP
SECTION_OUT_FMT
SECTION_OUT_SMP
SECTION_OUT_SMP_PAT
SECTION_STATEMENT
SECTION_TASK
SampleData
SourceCode

Attributes

constants[RW]
formats_src[RW]
options[R]
page[RW]
q[R]
samples[R]
sections[RW]
sources[R]

Public Class Methods

new(q, page = Mechanize::Page.new) { |self| ... } click to toggle source
# File lib/at_coder_friends/problem.rb, line 111
def initialize(q, page = Mechanize::Page.new)
  @q = q
  @page = page
  @sections = {}
  @samples = []
  @formats_src = []
  @constants = []
  @options = Options.new
  @sources = []
  yield self if block_given?
end

Public Instance Methods

add_smp(no, ext, txt) click to toggle source
# File lib/at_coder_friends/problem.rb, line 135
def add_smp(no, ext, txt)
  @samples << SampleData.new(no, ext, txt)
end
add_src(ext, txt) click to toggle source
# File lib/at_coder_friends/problem.rb, line 139
def add_src(ext, txt)
  @sources << SourceCode.new(ext, txt)
end
body_content() click to toggle source
# File lib/at_coder_friends/problem.rb, line 127
def body_content
  @body_content ||= page.search('body')[0]&.content
end
formats() click to toggle source
# File lib/at_coder_friends/problem.rb, line 131
def formats
  @formats ||= formats_src.reject { |f| f.container == :unknown }
end
url() click to toggle source
# File lib/at_coder_friends/problem.rb, line 123
def url
  @url ||= page.uri.to_s
end