class Attrocity::AttributeSet
Attributes
attributes[R]
Public Class Methods
new()
click to toggle source
# File lib/attrocity/attributes/attribute_set.rb, line 6 def initialize @attributes = Array.new end
Public Instance Methods
add(attrs)
click to toggle source
# File lib/attrocity/attributes/attribute_set.rb, line 10 def add(attrs) Array(attrs).each { |attr| attributes << attr } end
Also aliased as: <<
to_h()
click to toggle source
# File lib/attrocity/attributes/attribute_set.rb, line 15 def to_h Hash.new.tap do |h| attributes.each do |attr| h[attr.name] = attr.value end end end