Class: Dao::Errors::KeyPrefixer
- Inherits:
-
Object
- Object
- Dao::Errors::KeyPrefixer
- Defined in:
- lib/dao/errors.rb
Instance Attribute Summary collapse
-
#global ⇒ Object
Returns the value of attribute global.
-
#object ⇒ Object
Returns the value of attribute object.
-
#prefix(key) ⇒ Object
Returns the value of attribute prefix.
Instance Method Summary collapse
-
#initialize(object) ⇒ KeyPrefixer
constructor
A new instance of KeyPrefixer.
Constructor Details
#initialize(object) ⇒ KeyPrefixer
Returns a new instance of KeyPrefixer.
260 261 262 263 264 265 266 267 268 269 270 271 |
# File 'lib/dao/errors.rb', line 260 def initialize(object) @object = object @prefix = if @object && @object.respond_to?(:model_name) @object.model_name.to_s.underscore else nil end @global = Array(Global) end |
Instance Attribute Details
#global ⇒ Object
Returns the value of attribute global.
258 259 260 |
# File 'lib/dao/errors.rb', line 258 def global @global end |
#object ⇒ Object
Returns the value of attribute object.
256 257 258 |
# File 'lib/dao/errors.rb', line 256 def object @object end |
#prefix(key) ⇒ Object
Returns the value of attribute prefix.
257 258 259 |
# File 'lib/dao/errors.rb', line 257 def prefix @prefix end |