Module: PuppetX::EnterpriseModules::Oracle::Schemas
- Defined in:
- lib/puppet_x/enterprisemodules/oracle/schemas.rb
Overview
docs
Instance Method Summary collapse
- #autoextend(value) ⇒ Object
- #datafiles(value) ⇒ Object
- #extent_management(value) ⇒ Object
- #file_characteristics(value) ⇒ Object
- #file_specification(value) ⇒ Object
- #validate_extent_management(value) ⇒ Object
Instance Method Details
#autoextend(value) ⇒ Object
97 98 99 100 101 102 103 104 |
# File 'lib/puppet_x/enterprisemodules/oracle/schemas.rb', line 97 def autoextend(value) entry = ['autoextend on'] with_hash(value) do entry << content_if('next') entry << content_if('maxsize') end entry.compact.join(' ') end |
#datafiles(value) ⇒ Object
86 87 88 89 90 91 92 93 94 95 |
# File 'lib/puppet_x/enterprisemodules/oracle/schemas.rb', line 86 def datafiles(value) value = [value] unless value.is_a?(Array) # values can be either a Hash or an Array value.collect do |v| entry = [] with_hash(v) do entry << file_specification(v) end entry.compact.join(' ') end.compact.join(', ') end |
#extent_management(value) ⇒ Object
106 107 108 109 110 111 112 113 114 |
# File 'lib/puppet_x/enterprisemodules/oracle/schemas.rb', line 106 def extent_management(value) return_value = [] with_hash(value) do return_value << "extent management #{value_for('type')}" return_value << key_if('autoallocate') return_value << content_if('uniform_size') end return_value.compact.join(' ') end |
#file_characteristics(value) ⇒ Object
77 78 79 80 81 82 83 84 |
# File 'lib/puppet_x/enterprisemodules/oracle/schemas.rb', line 77 def file_characteristics(value) entry = [] with_hash(value) do entry << content_if('size') entry << key_if('reuse') end entry.join(' ') end |
#file_specification(value) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/puppet_x/enterprisemodules/oracle/schemas.rb', line 65 def file_specification(value) entry = [] with_hash(value) do autoextend_value = value_for('autoextend') entry << "'#{value_for('file_name')}'" if value_for('file_name') entry << content_if('size') entry << key_if('reuse') entry << autoextend(autoextend_value).to_s if exists?('autoextend') end entry.join(' ') end |
#validate_extent_management(value) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/puppet_x/enterprisemodules/oracle/schemas.rb', line 53 def validate_extent_management(value) # rubocop:disable Style/GuardClause if value # rubocop:enable Style/GuardClause with_hash(value) do type = value_for('type') raise ArgumentError, 'extent management dictionary, incompatible with autoallocate' if type.casecmp('dictionary').zero? && exists?('autoallocate') raise ArgumentError, 'extent management dictionary, incompatible with uniform_size' if type.casecmp('dictionary').zero? && exists?('uniform_size') end end end |