Module: RubyPsigate::HashVariables::ClassMethods

Defined in:
lib/ruby_psigate/hash_variables.rb

Instance Method Summary collapse

Instance Method Details

#hashable(*args) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/ruby_psigate/hash_variables.rb', line 24

def hashable(*args)
  @hashable_attributes ||= {}
  if args[0].is_a?(Symbol) && args[1].is_a?(Array)
    @hashable_attributes[args[0]] = args[1]
  elsif args[0].is_a?(Array)
    @hashable_attributes[:default] = args[0]
  else
    raise ArgumentError
  end
end

#hashable_attributesObject



35
36
37
# File 'lib/ruby_psigate/hash_variables.rb', line 35

def hashable_attributes
  @hashable_attributes
end