Module: PuppetX::EnterpriseModules::Oracle::DatafileProperty

Defined in:
lib/puppet_x/enterprisemodules/oracle/datafile_property.rb

Overview

Docs

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(parent) ⇒ Object



11
12
13
14
15
16
# File 'lib/puppet_x/enterprisemodules/oracle/datafile_property.rb', line 11

def self.included(parent)
  parent.send(:include, ::PuppetX::EnterpriseModules::Oracle::Access)
  parent.send(:include, ::PuppetX::EnterpriseModules::Oracle::Information)
  parent.send(:include, ::EasyType)
  parent.extend(ClassMethods)
end

Instance Method Details

#after_applyObject

rubocop:enable Lint/LiteralAsCondition



80
81
82
# File 'lib/puppet_x/enterprisemodules/oracle/datafile_property.rb', line 80

def after_apply
  nil
end

#autoextend_specObject



38
39
40
41
42
43
44
45
46
# File 'lib/puppet_x/enterprisemodules/oracle/datafile_property.rb', line 38

def autoextend_spec
  if resource[:autoextend].to_s == 'on'
    "autoextend #{resource[:autoextend]} #{next_clause} #{maxsize_clause}"
  elsif resource[:autoextend].nil?
    ''
  else
    "autoextend #{resource[:autoextend]}"
  end
end

#current_num_datafilesObject



56
57
58
# File 'lib/puppet_x/enterprisemodules/oracle/datafile_property.rb', line 56

def current_num_datafiles
  provider.num_datafiles.to_i
end

#desired_num_datafilesObject



52
53
54
# File 'lib/puppet_x/enterprisemodules/oracle/datafile_property.rb', line 52

def desired_num_datafiles
  resource.num_datafiles.to_i
end

#df_array_size(df) ⇒ Object



48
49
50
# File 'lib/puppet_x/enterprisemodules/oracle/datafile_property.rb', line 48

def df_array_size(df)
  df.nil? || (df.to_s == 'absent') ? 0 : df.length
end

#file_typeObject



18
19
20
# File 'lib/puppet_x/enterprisemodules/oracle/datafile_property.rb', line 18

def file_type
  resource[:contents].to_s == 'temporary' ? 'tempfile' : 'datafile'
end

#maxsize_clauseObject



30
31
32
33
34
35
36
# File 'lib/puppet_x/enterprisemodules/oracle/datafile_property.rb', line 30

def maxsize_clause
  if resource[:max_size]
    "maxsize #{resource[:max_size]}"
  else
    ''
  end
end

#next_clauseObject



22
23
24
25
26
27
28
# File 'lib/puppet_x/enterprisemodules/oracle/datafile_property.rb', line 22

def next_clause
  if resource[:next]
    "next #{resource[:next]}"
  else
    ''
  end
end

#ts_contentsObject



64
65
66
# File 'lib/puppet_x/enterprisemodules/oracle/datafile_property.rb', line 64

def ts_contents
  self['contents'].to_s == 'permanent' ? '' : self['contents']
end

#ts_encryptionObject

rubocop:disable Lint/LiteralAsCondition



69
70
71
72
73
74
75
76
77
# File 'lib/puppet_x/enterprisemodules/oracle/datafile_property.rb', line 69

def ts_encryption
  if self['encryption'].nil?
    ''
  elsif :true
    'encryption default storage (encrypt)'
  else
    "encryption using '#{encryption}' default storage (encrypt)"
  end
end

#ts_typeObject



60
61
62
# File 'lib/puppet_x/enterprisemodules/oracle/datafile_property.rb', line 60

def ts_type
  self['bigfile'].to_s == 'yes' ? 'bigfile' : ''
end