Class: Google::Storage::Property::StringArray

Inherits:
Array
  • Object
show all
Defined in:
lib/google/storage/property/string_array.rb

Overview

A Puppet property that can compare its values

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Array

#match_all?, match_all_array

Methods inherited from Base

#insync?

Class Method Details

.api_munge(value) ⇒ Object



44
45
46
47
# File 'lib/google/storage/property/string_array.rb', line 44

def self.api_munge(value)
  validate value
  value
end

.unsafe_munge(value) ⇒ Object



35
36
37
38
# File 'lib/google/storage/property/string_array.rb', line 35

def self.unsafe_munge(value)
  validate value
  value
end

.validate(value) ⇒ Object



49
50
51
52
53
54
55
# File 'lib/google/storage/property/string_array.rb', line 49

def self.validate(value)
  return if value.nil? || value.is_a?(::String)
  unless value.is_a? ::Array
    raise "Expected string but found #{value.class} instead: #{value}"
  end
  value.each { |v| validate v }
end

Instance Method Details

#unsafe_munge(value) ⇒ Object



40
41
42
# File 'lib/google/storage/property/string_array.rb', line 40

def unsafe_munge(value)
  self.class.unsafe_munge(value)
end