Module: EasyAttributes
- Defined in:
- lib/easy_attributes.rb,
lib/easy_attributes/version.rb
Overview
EasyAttributes Module - Provides attribute handling enahancements.
Features include:
* Attribute Enum support, giving symbolic names for numeric or other values
* Provides optional ActiveModel ORM enhancements for validations, etc.
* Byte datatype helpers
* Fixed-decimal datatype (e.g. Dollars) helpers
To Use:
* Require the easy_attributes gem if you need.
* Mix in the EasyAttributes module into your class.
* Load any external enum definitions at application start-up
* Define attribute enhancers in your class
Gemfile (add entry, then `bundle install`):
gem 'easy_attributes'
Or manually
require 'easy_attributes'
Then
class MyClass
include EasyAttributes
attr_enum :my_attribute, :zero, :one, :two
end
Defined Under Namespace
Modules: ClassMethods, FixedPoint Classes: Config, Definition, Value
Constant Summary collapse
- VERSION =
"0.2.0"
Class Method Summary collapse
-
.included(base) ⇒ Object
Called by Ruby after including to add our ClassMethods to the parent class.
Class Method Details
.included(base) ⇒ Object
Called by Ruby after including to add our ClassMethods to the parent class
34 35 36 |
# File 'lib/easy_attributes.rb', line 34 def self.included(base) #:nodoc: base.extend(ClassMethods) end |