class SetBuilder::ModifierCollection

Public Instance Methods

to_hash() click to toggle source

def [](index)

case index
when Symbol, String
  index = index.to_s
  self.find {|trait| trait.name == index}
else
  super
end

end

# File lib/set_builder/modifier_collection.rb, line 18
def to_hash
  hash = {}
  each do |modifier|
    hash[Modifier.name(modifier).to_s] = modifier.to_hash
  end
  hash
end
to_json() click to toggle source
# File lib/set_builder/modifier_collection.rb, line 28
def to_json
  to_hash.to_json
end