class Repoaccessor::XMLFile
Attributes
kv_pairs[RW]
Public Class Methods
new()
click to toggle source
# File lib/repoaccessor/xmlfile.rb, line 33 def initialize @kv_pairs = [] end
Public Instance Methods
build_hash() { |hash, pair| ... }
click to toggle source
# File lib/repoaccessor/xmlfile.rb, line 61 def build_hash(&block) hash = {} @kv_pairs.each do |pair| yield hash, pair end hash end
key_values()
click to toggle source
# File lib/repoaccessor/xmlfile.rb, line 37 def key_values #TODO:不影响主功能 end
keys()
click to toggle source
# File lib/repoaccessor/xmlfile.rb, line 41 def keys #TODO:不影响主功能 end
to_hash(args={})
click to toggle source
# File lib/repoaccessor/xmlfile.rb, line 49 def to_hash(args={}) with_comments = args[:with_comments].nil? ? true : args[:with_comments] build_hash { |hash, pair| hash_value = with_comments ? { pair.value => pair.comment } : pair.value hash[pair.key] = hash_value } end
to_json()
click to toggle source
# File lib/repoaccessor/xmlfile.rb, line 57 def to_json self.to_hash(:with_comments => false).to_json end
values()
click to toggle source
# File lib/repoaccessor/xmlfile.rb, line 45 def values #TODO:不影响主功能 end