Class: Puppet::Util::TagSet

Inherits:
Set
  • Object
show all
Includes:
Network::FormatSupport
Defined in:
lib/puppet/util/tag_set.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Network::FormatSupport

included, #mime, #render, #support_format?, #to_json, #to_msgpack, #to_pson

Class Method Details

.from_data_hash(data) ⇒ Object



18
19
20
# File 'lib/puppet/util/tag_set.rb', line 18

def self.from_data_hash(data)
  new(data)
end

.from_yaml(yaml) ⇒ Object



9
10
11
# File 'lib/puppet/util/tag_set.rb', line 9

def self.from_yaml(yaml)
  new(Puppet::Util::Yaml.safe_load(yaml, [Symbol]))
end

Instance Method Details

#join(*args) ⇒ Object



27
28
29
# File 'lib/puppet/util/tag_set.rb', line 27

def join(*args)
  to_a.join(*args)
end

#to_data_hashObject

TODO: A method named #to_data_hash should not return an array



23
24
25
# File 'lib/puppet/util/tag_set.rb', line 23

def to_data_hash
  to_a
end

#to_yamlObject



13
14
15
16
# File 'lib/puppet/util/tag_set.rb', line 13

def to_yaml
  # Ruby 4 changed Set's internal structure, use to_a instead of @hash.keys
  to_a.to_yaml
end