Class: Sfp::Helper::SfpFlatten

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSfpFlatten

Returns a new instance of SfpFlatten.



712
713
714
# File 'lib/nuri/master.rb', line 712

def initialize
	@results = {}
end

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results.



710
711
712
# File 'lib/nuri/master.rb', line 710

def results
  @results
end

Instance Method Details

#visit(name, value, parent) ⇒ Object



716
717
718
719
720
721
722
723
724
725
726
727
728
729
# File 'lib/nuri/master.rb', line 716

def visit(name, value, parent)
	return false if name[0,1] == '_'
	if value.is_a?(Hash)
		return true if value['_context'] == 'object'

		@results[parent.ref.push(name)] = value if value['_context'] == 'null'
		@results[parent.ref.push(name)] = value if value['_context'] == 'set'

		return false
	end

	@results[parent.ref.push(name)] = value
	false
end