Module: Essentials

Included in:
Atome
Defined in:
lib/atome/utilities/essentials.rb

Overview

use to sanitize and secure user input

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_paramsObject



53
54
55
# File 'lib/atome/utilities/essentials.rb', line 53

def self.default_params
  @default_params
end

.new_default_params(new_default) ⇒ Object



57
58
59
# File 'lib/atome/utilities/essentials.rb', line 57

def self.new_default_params(new_default)
  @default_params.merge!(new_default)
end

Instance Method Details

#add_essential_drm(params) ⇒ Object



66
67
68
69
70
71
72
73
74
# File 'lib/atome/utilities/essentials.rb', line 66

def add_essential_drm(params)
  essential_drm = { authorisation: { read: [Atome.current_user], write: [Atome.current_user] },
                    atome: { read: [:all], write: [:me] } }
  params[:drm] = if params[:drm]
                   essential_drm.merge(params[:drm])
                 else
                   essential_drm
                 end
end

#validation(atome_instance_var) ⇒ Object



61
62
63
64
# File 'lib/atome/utilities/essentials.rb', line 61

def validation(atome_instance_var)
  # TODO: write validation scheme
  true if atome_instance_var
end