Class: SolvePb::Problem
- Inherits:
-
Object
- Object
- SolvePb::Problem
- Defined in:
- lib/solve_pb/problem.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#sample_input ⇒ Object
Returns the value of attribute sample_input.
-
#sample_output ⇒ Object
Returns the value of attribute sample_output.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #download_pdf ⇒ Object
-
#initialize(url, name, sample_input, sample_output) ⇒ Problem
constructor
A new instance of Problem.
Constructor Details
#initialize(url, name, sample_input, sample_output) ⇒ Problem
Returns a new instance of Problem.
6 7 8 9 10 11 |
# File 'lib/solve_pb/problem.rb', line 6 def initialize(url, name, sample_input, sample_output) @url = url @name = name @sample_input = sample_input @sample_output = sample_output end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/solve_pb/problem.rb', line 4 def name @name end |
#sample_input ⇒ Object
Returns the value of attribute sample_input.
4 5 6 |
# File 'lib/solve_pb/problem.rb', line 4 def sample_input @sample_input end |
#sample_output ⇒ Object
Returns the value of attribute sample_output.
4 5 6 |
# File 'lib/solve_pb/problem.rb', line 4 def sample_output @sample_output end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/solve_pb/problem.rb', line 4 def url @url end |
Instance Method Details
#download_pdf ⇒ Object
13 14 15 |
# File 'lib/solve_pb/problem.rb', line 13 def download_pdf "https://www.hackerrank.com/rest/contests/master/challenges/#{name}/download_pdf?language=English" end |