Module: Further::Core::LocalInstanceMethods

Defined in:
lib/further/core.rb

Instance Method Summary collapse

Instance Method Details

#further_info(attributes = {}) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/further/core.rb', line 23

def further_info(attributes = {})
  further = self.further_information
  info = {}
  
  if attributes.present? # Set
    
    if further
      attributes.each_pair do |key, value|
        further.info[key] = value
      end
      further.save
    else
      further = self.build_further_information info: attributes
      further.save
    end
    info = further.info

  else # Get          
    info = further.info if further
  end
  info
end