Class: RubyScreen::Configuration::Parser::Iterator

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_screen/configuration/parser/iterator.rb

Instance Method Summary collapse

Constructor Details

#initialize(arguments, preferences_hash) ⇒ Iterator

Returns a new instance of Iterator.



3
4
5
# File 'lib/ruby_screen/configuration/parser/iterator.rb', line 3

def initialize(arguments, preferences_hash)
  @arguments, @preferences_hash = arguments, preferences_hash
end

Instance Method Details

#each_applicable_configuration_block {|current_preferences_block| ... } ⇒ Object

Yields:

  • (current_preferences_block)


7
8
9
10
11
12
13
14
15
# File 'lib/ruby_screen/configuration/parser/iterator.rb', line 7

def each_applicable_configuration_block(&block)
  yield current_preferences_block

  until preferences_exhausted?
    @preferences_hash = @preferences_hash[@arguments.first]
    @arguments.shift
    yield current_preferences_block
  end
end