Module: Attributary::DSL::Helpers
- Included in:
- ClassMethods
- Defined in:
- lib/attributary/dsl/helpers.rb
Instance Method Summary collapse
- #_attributary_attribute_set ⇒ Object
- #_attributary_attributes ⇒ Object
- #_attributary_config ⇒ Object
- #_attributary_errors ⇒ Object
- #_attributary_valid? ⇒ Boolean
- #attributary(&block) ⇒ Object
- #attributary_errors ⇒ Object
Instance Method Details
#_attributary_attribute_set ⇒ Object
12 13 14 |
# File 'lib/attributary/dsl/helpers.rb', line 12 def _attributary_attribute_set @_attributary_attribute_set ||= {} end |
#_attributary_attributes ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/attributary/dsl/helpers.rb', line 24 def _attributary_attributes hash = {} _attributary_attribute_set.keys.each do |k| hash[k] = instance_variable_get(:"@#{k}") end hash end |
#_attributary_config ⇒ Object
8 9 10 |
# File 'lib/attributary/dsl/helpers.rb', line 8 def _attributary_config @_attributary_config ||= Attributary::Config.new end |
#_attributary_errors ⇒ Object
16 17 18 |
# File 'lib/attributary/dsl/helpers.rb', line 16 def _attributary_errors @_attributary_errors ||= {} end |
#_attributary_valid? ⇒ Boolean
32 33 34 |
# File 'lib/attributary/dsl/helpers.rb', line 32 def _attributary_valid? _attributary_errors.empty? end |
#attributary(&block) ⇒ Object
4 5 6 |
# File 'lib/attributary/dsl/helpers.rb', line 4 def attributary(&block) block.call(_attributary_config) end |
#attributary_errors ⇒ Object
20 21 22 |
# File 'lib/attributary/dsl/helpers.rb', line 20 def attributary_errors _attributary_errors end |