Class: Audrey::Query::Q0::Fields

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/audrey/query/q0.rb

Overview

Audrey::Query::Q0::Fields

Instance Method Summary collapse

Constructor Details

#initializeFields


initialize



267
268
269
# File 'lib/audrey/query/q0.rb', line 267

def initialize
	@hsh = {}
end

Instance Method Details

#add(key, val) ⇒ Object


add



278
279
280
281
282
283
284
# File 'lib/audrey/query/q0.rb', line 278

def add(key, val)
	if not @hsh[key].is_a?(Array)
		@hsh[key] = [@hsh[key]]
	end
	
	@hsh[key].push val
end

#cloneObject


clone



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'lib/audrey/query/q0.rb', line 293

def clone
	rv = self.class.new()
	
	# fields
	@hsh.each do |k,v|
		if v.is_a?(Array)
			rv[k] = v.clone
		else
			rv[k] = v
		end
	end
	
	# return
	return rv
end