Class: Charisma::Characterization
- Inherits:
-
Hash
- Object
- Hash
- Charisma::Characterization
- Includes:
- Blockenspiel::DSL
- Defined in:
- lib/charisma/characterization.rb
Overview
Stores the set of characteristics defined on a class.
Typically this is created with Charisma::Base::ClassMethods#characterize
, and characteristics defined within it by the ensuing block.
Instance Method Summary collapse
-
#has(name, options = {}, &blk) ⇒ Object
Define a characteristic.
Instance Method Details
#has(name, options = {}, &blk) ⇒ Object
Define a characteristic.
This is used within Charisma::Base::ClassMethods#characterize
blocks to curate attributes on a class. Internally, a Charisma::Characteristic
is created to store the definition.
19 20 21 22 |
# File 'lib/charisma/characterization.rb', line 19 def has(name, = {}, &blk) name = name.to_sym self[name] = Characteristic.new(name, , &blk) end |