Class: BCDD::Value::Registry
- Inherits:
-
Object
- Object
- BCDD::Value::Registry
- Includes:
- Singleton
- Defined in:
- lib/bcdd/ext/value.rb
Instance Attribute Summary collapse
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
Constructor Details
#initialize ⇒ Registry
Returns a new instance of Registry.
112 113 114 |
# File 'lib/bcdd/ext/value.rb', line 112 def initialize @registry = {} end |
Instance Attribute Details
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
110 111 112 |
# File 'lib/bcdd/ext/value.rb', line 110 def registry @registry end |
Class Method Details
.read(name) ⇒ Object
124 125 126 127 128 |
# File 'lib/bcdd/ext/value.rb', line 124 def self.read(name) value_object = instance.registry[name] value_object or raise ArgumentError, "#{name.inspect} is not registered" end |