Class: AtCoderFriends::DataSample

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(no, ext, txt) ⇒ DataSample

Returns a new instance of DataSample.



5
6
7
8
9
# File 'lib/at_coder_friends/problem.rb', line 5

def initialize(no, ext, txt)
  no = no.tr('0-9', '0-9').to_i
  txt = txt.lstrip.gsub("\r\n", "\n")
  super(no, ext, txt)
end

Instance Attribute Details

#extObject

Returns the value of attribute ext

Returns:

  • (Object)

    the current value of ext



4
5
6
# File 'lib/at_coder_friends/problem.rb', line 4

def ext
  @ext
end

#noObject

Returns the value of attribute no

Returns:

  • (Object)

    the current value of no



4
5
6
# File 'lib/at_coder_friends/problem.rb', line 4

def no
  @no
end

#txtObject

Returns the value of attribute txt

Returns:

  • (Object)

    the current value of txt



4
5
6
# File 'lib/at_coder_friends/problem.rb', line 4

def txt
  @txt
end