Class: ReadyForI18N::NoKeyDictionary
- Inherits:
-
Object
- Object
- ReadyForI18N::NoKeyDictionary
- Defined in:
- lib/no_key_dictionary.rb
Instance Method Summary collapse
-
#initialize(locale = nil) ⇒ NoKeyDictionary
constructor
A new instance of NoKeyDictionary.
- #push(key, value, path = nil) ⇒ Object
- #write_to(out) ⇒ Object
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 |