Module: Attributary::DSL::Helpers

Included in:
ClassMethods
Defined in:
lib/attributary/dsl/helpers.rb

Instance Method Summary collapse

Instance Method Details

#_attributary_attribute_setObject



12
13
14
# File 'lib/attributary/dsl/helpers.rb', line 12

def _attributary_attribute_set
  @_attributary_attribute_set ||= {}
end

#_attributary_attributesObject



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_configObject



8
9
10
# File 'lib/attributary/dsl/helpers.rb', line 8

def _attributary_config
  @_attributary_config ||= Attributary::Config.new
end

#_attributary_errorsObject



16
17
18
# File 'lib/attributary/dsl/helpers.rb', line 16

def _attributary_errors
  @_attributary_errors ||= {}
end

#_attributary_valid?Boolean

Returns:

  • (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_errorsObject



20
21
22
# File 'lib/attributary/dsl/helpers.rb', line 20

def attributary_errors
  _attributary_errors
end