class Ceres::Attribute

Attributes

description[RW]
inspector[RW]
name[R]
reader[RW]
target[RW]
variable[RW]
writer[RW]

Public Class Methods

new(name, &block) click to toggle source
# File lib/ceres/attribute.rb, line 86
def initialize(name, &block)
  @name = name.to_sym

  @description = nil
  @variable = "@#{name}".to_sym

  @reader = Ceres::Reader.new(self)
  @writer = nil
  @inspector = Ceres::Inspector.new

  Ceres::Attribute::DSL.new(self, &block)
end

Public Instance Methods

apply(klass) click to toggle source
# File lib/ceres/attribute.rb, line 99
def apply(klass)
  @reader.apply(klass) if @reader
  @writer.apply(klass) if @writer

  klass
end