Class: Puppet::ResourceApi::BaseContext
- Inherits:
-
Object
- Object
- Puppet::ResourceApi::BaseContext
- Defined in:
- lib/puppet_x/puppetlabs/panos/transport_shim.rb
Overview
monkey patch for the transport context for continued module support
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(definition) ⇒ BaseContext
constructor
A new instance of BaseContext.
-
#transport ⇒ Object
:nocov: patch for returning the device in the context.transport calls.
Constructor Details
#initialize(definition) ⇒ BaseContext
Returns a new instance of BaseContext.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/puppet_x/puppetlabs/panos/transport_shim.rb', line 18 def initialize(definition) if definition.is_a?(Hash) # this is only for backwards compatibility @type = Puppet::ResourceApi::TypeDefinition.new(definition) elsif definition.is_a? Puppet::ResourceApi::BaseTypeDefinition @type = definition else #:nocov: raise ArgumentError, 'BaseContext requires definition to be a child of Puppet::ResourceApi::BaseTypeDefinition, not <%{actual_type}>' % { actual_type: definition.class } #:nocov: end end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
16 17 18 |
# File 'lib/puppet_x/puppetlabs/panos/transport_shim.rb', line 16 def type @type end |
Instance Method Details
#transport ⇒ Object
:nocov: patch for returning the device in the context.transport calls
34 35 36 |
# File 'lib/puppet_x/puppetlabs/panos/transport_shim.rb', line 34 def transport device.transport end |