class Perpetuity::AttributeSet

Public Class Methods

new(*attributes) click to toggle source
# File lib/perpetuity/attribute_set.rb, line 5
def initialize *attributes
  @attributes = {}
  attributes.each do |attribute|
    self << attribute
  end
end

Public Instance Methods

<<(attribute) click to toggle source
# File lib/perpetuity/attribute_set.rb, line 12
def << attribute
  @attributes[attribute.name] = attribute
  self
end
[](name) click to toggle source
# File lib/perpetuity/attribute_set.rb, line 17
def [] name
  @attributes[name]
end
each(&block) click to toggle source
# File lib/perpetuity/attribute_set.rb, line 21
def each &block
  @attributes.each_value(&block)
end