Class: ReadyForI18N::NoKeyDictionary

Inherits:
Object
  • Object
show all
Defined in:
lib/no_key_dictionary.rb

Instance Method Summary collapse

Constructor Details

#initialize(locale = nil) ⇒ NoKeyDictionary

Returns a new instance of NoKeyDictionary.



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

def initialize(locale = nil)
  @set = Set.new
end

Instance Method Details

#push(key, value, path = nil) ⇒ Object



7
8
9
# File 'lib/no_key_dictionary.rb', line 7

def push(key,value,path = nil)
  @set << value if value && !value.strip.empty?
end

#write_to(out) ⇒ Object



10
11
12
# File 'lib/no_key_dictionary.rb', line 10

def write_to(out)
  @set.each { |e| out.puts e }
end