module Junos::Ez::Provider

Constants

PROPERTIES

all managed objects have the following properties:

Public Class Methods

attach_instance_variable( on_obj, varsname, new_obj ) click to toggle source

'attach_instance_variable' is the way to dynamically add an instance variable to the on_obj and “publish” it in the same way attr_accessor would.

# File lib/junos-ez/provider.rb, line 60
def self.attach_instance_variable( on_obj, varsname, new_obj )
  ivar = ("@" + varsname.to_s).to_sym
  on_obj.instance_variable_set( ivar, new_obj )
  on_obj.define_singleton_method( varsname ) do
    on_obj.instance_variable_get( ivar )
  end    
  on_obj.providers << varsname
end