Parent

Methods

PseudoHash

Public Class Methods

[](*pairs) click to toggle source
# File lib/arrayfields.rb, line 429
def [](*pairs)
  pairs.flatten!
  raise ArgumentError, "argument must be key/val pairs" unless 
    (pairs.size % 2 == 0 and pairs.size >= 2)
  keys, values = [], []
  while((k = pairs.shift) and (v = pairs.shift)) 
    keys << k and values << v
  end
  new keys, values
end
new(keys = [], values = []) click to toggle source
# File lib/arrayfields.rb, line 440
def initialize keys = [], values = []
  self.fields = keys
  self.replace values
end

Public Instance Methods

to_yaml(opts = {}) click to toggle source
# File lib/arrayfields.rb, line 444
def to_yaml opts = {}
  YAML::quick_emit object_id, opts do |out|
    out.map taguri, to_yaml_style do |map|
      each_pair{|f,v| map.add f,v}
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.