module Representation::ActiveRecord::ClassMethods
Public Instance Methods
representation(name, *attributes_and_method_names)
click to toggle source
# File lib/representation/active_record.rb, line 16 def representation(name, *attributes_and_method_names) representations[name] = attributes_and_method_names end
representation_names()
click to toggle source
# File lib/representation/active_record.rb, line 19 def representation_names representations.keys end
values_for_representation(name)
click to toggle source
# File lib/representation/active_record.rb, line 22 def values_for_representation(name) raise UnknownRepresentationError, "Unknown Representation '#{name}'" unless representation_names.include?(name) representations[name] end