module Property::Declaration::Base

This is just a helper module that includes the necessary code for property definition, but without the validation/save hooks.

Attributes

schema[RW]

Every class has it’s own schema.

Public Class Methods

included(base) click to toggle source
# File lib/property/declaration.rb, line 17
def self.included(base)
  base.class_eval do
    extend  ClassMethods
    include InstanceMethods

    class << self
      # Every class has it's own schema.
      attr_accessor :schema

      def schema
        @schema ||= make_schema
      end

      private
        # Build schema and manage inheritance.
        def make_schema
          Property::Schema.new(self.to_s, :class => self)
        end
    end
  end
end

Private Class Methods

make_schema() click to toggle source

Build schema and manage inheritance.

# File lib/property/declaration.rb, line 32
def make_schema
  Property::Schema.new(self.to_s, :class => self)
end