Class: Ostructer::OsBase
Overview
NB: key.first -> different with Rails or without (without results in more than one letter!!)
Direct Known Subclasses
Instance Attribute Summary collapse
-
#field ⇒ Object
read,write.
-
#logger ⇒ Object
readonly
base for OsArray/OsOpenStruct/OsOpenStructNil.
-
#parent ⇒ Object
read,write.
Instance Method Summary collapse
Instance Attribute Details
#logger ⇒ Object (readonly)
base for OsArray/OsOpenStruct/OsOpenStructNil
32 33 34 |
# File 'lib/ostructer.rb', line 32 def logger @logger end |
Instance Method Details
#full_dot_path ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/ostructer.rb', line 36 def full_dot_path path = "#{@field}" node = @parent ## NOTE: assume if parent == nil openstruct is root node while node && node.parent # logger.debug "node.class: #{node.class}, node.field: #{node.field}" if node.is_a?( OsArray ) path = "#{node.field}" + path else path = "#{node.field}." + path end node = node.parent end path end |