Class: DtkCommon::DSL::FileParser::OutputHash

Inherits:
DTK::Common::SimpleHashObject
  • Object
show all
Defined in:
lib/dsl/file_parser.rb

Instance Method Summary collapse

Instance Method Details

#+(output_obj) ⇒ Object



124
125
126
127
128
129
130
131
132
133
134
# File 'lib/dsl/file_parser.rb', line 124

def +(output_obj)
  if output_obj.kind_of?(OutputArray)
    OutputArray.new(self) + output_obj
  elsif output_obj.kind_of?(OutputHash)
    merge(output_obj)
  elsif output_obj.nil?
    self
  else
    raise Error.new("Unexpected object type (#{output_obj.class})")
  end
end

#merge_non_empty!(hash) ⇒ Object



119
120
121
122
# File 'lib/dsl/file_parser.rb', line 119

def merge_non_empty!(hash)
  hash.each{|k,v| merge!(k => v) unless v.nil? or v.empty?}
  self
end