module LogicalModel::Attributes::ClassMethods

Public Instance Methods

attribute(name) click to toggle source

declares an attribute. @param name [Symbol] @example

class Client < LogicalModel
  attribute :att_name
end
# File lib/logical_model/attributes.rb, line 39
def attribute(name)
  @attribute_keys = [] if @attribute_keys.nil?
  @attribute_keys << name
  attr_accessor name
end
attribute_keys() click to toggle source
# File lib/logical_model/attributes.rb, line 52
def attribute_keys
  @attribute_keys
end
attribute_keys=(keys) click to toggle source

overrides attributes with given keys. @param keys [Array<Symbol>]

# File lib/logical_model/attributes.rb, line 47
def attribute_keys=(keys)
  @attribute_keys = keys
  attr_accessor *keys
end