Define aliases to the fully qualified attributes
# File lib/big_record/family_span_columns.rb, line 31 def alias_attribute_with_family_span_columns(alias_name, fully_qualified_name) # when it's a single column everything's normal but when it's a # column family then this actually add accessors for the whole family alias_attribute_without_family_span_columns(alias_name, fully_qualified_name) # fully_qualified_name ends with ':' => consider it a family span column if fully_qualified_name.ends_with?(":") # add the accessors for the individual columns self.class_eval def #{alias_name}(column_key=nil) if column_key read_attribute("#{fully_qualified_name}\#{column_key}") else read_family_attributes("#{fully_qualified_name}") end end def set_#{alias_name}(column_key, value) write_attribute("#{fully_qualified_name}\#{column_key}", value) end end end
Generated with the Darkfish Rdoc Generator 2.