Class: Puppet::Pops::Loader::StaticLoader

Inherits:
Loader show all
Defined in:
lib/puppet/pops/loader/static_loader.rb

Constant Summary collapse

BUILTIN_TYPE_NAMES =
%w{
  Auegas
  Component
  Computer
  Cron
  Exec
  File
  Filebucket
  Group
  Host
  Interface
  K5login
  Macauthorization
  Mailalias
  Maillist
  Mcx
  Mount
  Nagios_command
  Nagios_contact
  Nagios_contactgroup
  Nagios_host
  Nagios_hostdependency
  Nagios_hostescalation
  Nagios_hostgroup
  Nagios_hostextinfo
  Nagios_service
  Nagios_servicedependency
  Nagios_serviceescalation
  Nagios_serviceextinfo
  Nagios_servicegroup
  Nagios_timeperiod
  Notify
  Package
  Resources
  Router
  Schedule
  Scheduled_task
  Selboolean
  Selmodule
  Service
  Ssh_authorized_key
  Sshkey
  Stage
  Tidy
  User
  Vlan
  Whit
  Yumrepo
  Zfs
  Zone
  Zpool
}.freeze
BUILTIN_TYPE_NAMES_LC =
Set.new(BUILTIN_TYPE_NAMES.map { |n| n.downcase }).freeze

Constants inherited from Loader

Loader::LOADABLE_KINDS

Instance Attribute Summary collapse

Attributes inherited from Loader

#loader_name

Instance Method Summary collapse

Methods inherited from Loader

#[], #inspect, #load, #loadables, #private_loader, #set_entry

Constructor Details

#initializeStaticLoader

Returns a new instance of StaticLoader.



64
65
66
67
68
# File 'lib/puppet/pops/loader/static_loader.rb', line 64

def initialize
  @loaded = {}
  create_built_in_types()
  create_resource_type_references()
end

Instance Attribute Details

#loadedObject (readonly)



63
64
65
# File 'lib/puppet/pops/loader/static_loader.rb', line 63

def loaded
  @loaded
end

Instance Method Details

#find(name) ⇒ Object



78
79
80
81
# File 'lib/puppet/pops/loader/static_loader.rb', line 78

def find(name)
  # There is nothing to search for, everything this loader knows about is already available
  nil
end

#get_entry(typed_name) ⇒ Object



74
75
76
# File 'lib/puppet/pops/loader/static_loader.rb', line 74

def get_entry(typed_name)
  load_constant(typed_name)
end

#load_typed(typed_name) ⇒ Object



70
71
72
# File 'lib/puppet/pops/loader/static_loader.rb', line 70

def load_typed(typed_name)
  load_constant(typed_name)
end

#loaded_entry(typed_name, _) ⇒ Object



91
92
93
# File 'lib/puppet/pops/loader/static_loader.rb', line 91

def loaded_entry(typed_name, _)
  @loaded[typed_name]
end

#parentObject



83
84
85
# File 'lib/puppet/pops/loader/static_loader.rb', line 83

def parent
  nil # at top of the hierarchy
end

#to_sObject



87
88
89
# File 'lib/puppet/pops/loader/static_loader.rb', line 87

def to_s()
  "(StaticLoader)"
end