Class: Arb::Api::OtherSolutions
- Inherits:
-
Object
- Object
- Arb::Api::OtherSolutions
- Defined in:
- lib/arb/api/other_solutions.rb
Instance Method Summary collapse
-
#initialize(year:, day:, part:) ⇒ OtherSolutions
constructor
A new instance of OtherSolutions.
- #other_solutions ⇒ Object
Constructor Details
#initialize(year:, day:, part:) ⇒ OtherSolutions
Returns a new instance of OtherSolutions.
6 7 8 9 10 11 |
# File 'lib/arb/api/other_solutions.rb', line 6 def initialize(year:, day:, part:) @year = year @day = day @part = part @gem_directory = Gem.loaded_specs["advent_of_ruby"].gem_dir end |
Instance Method Details
#other_solutions ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/arb/api/other_solutions.rb', line 13 def other_solutions unless File.exist?(reddit_file_path) return end "#{year} Day #{day.to_i} Part #{part}\n\n" \ "#{github_solutions}" \ "#{reddit_solutions if part.to_i == 2}".rstrip + "\n" end |