Class: Rungs::Climb
- Inherits:
-
Object
- Object
- Rungs::Climb
- Includes:
- PayDirt::UseCase
- Defined in:
- lib/rungs/climb.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options = {}) ⇒ Climb
constructor
A new instance of Climb.
Constructor Details
#initialize(options = {}) ⇒ Climb
Returns a new instance of Climb.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rungs/climb.rb', line 7 def initialize( = {}) = { list: "selected_four-letter_words.txt", steps: 1, file_class: File, word_ladder_class: Rungs::WordLadder }.merge() () end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rungs/climb.rb', line 18 def call ret_hash = {} @file_class.readlines(@list).each do |word| ret_hash[word.chomp] = @word_ladder_class.new({ word: word.chomp, list: @list, steps: @steps }).call.data end return result(true, ret_hash) end |