Class: Decouplio::DefaultMetaStore
- Inherits:
-
Object
- Object
- Decouplio::DefaultMetaStore
- Defined in:
- lib/decouplio/default_meta_store.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #add_error(key, messages) ⇒ Object
-
#initialize ⇒ DefaultMetaStore
constructor
A new instance of DefaultMetaStore.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ DefaultMetaStore
Returns a new instance of DefaultMetaStore.
8 9 10 11 |
# File 'lib/decouplio/default_meta_store.rb', line 8 def initialize @errors = {} @status = nil end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'lib/decouplio/default_meta_store.rb', line 6 def errors @errors end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/decouplio/default_meta_store.rb', line 5 def status @status end |
Instance Method Details
#add_error(key, messages) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/decouplio/default_meta_store.rb', line 13 def add_error(key, ) @errors.store( key, (@errors[key] || []) + [].flatten ) end |
#to_s ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/decouplio/default_meta_store.rb', line 20 def to_s <<~METASTORE Status: #{@status || 'NONE'} Errors: #{errors_string} METASTORE end |