Module: OmfRc::ResourceProxyDSL

Included in:
ResourceFactory, OmfRc::ResourceProxy::AbstractResource, OmfRc::ResourceProxy::Application, OmfRc::ResourceProxy::Net, OmfRc::ResourceProxy::Node, OmfRc::ResourceProxy::Package, OmfRc::ResourceProxy::VirtualMachine, OmfRc::ResourceProxy::VirtualMachineFactory, OmfRc::ResourceProxy::Wlan, Util::CommonTools, Util::Fact, Util::Hostapd, Util::Ip, Util::Iw, Util::Libvirt, Util::Mod, Util::OpenflowTools, Util::PlatformTools, Util::Sysfs, Util::Topology, Util::Vmbuilder, Util::Wpa
Defined in:
omf_rc/lib/omf_rc/resource_proxy_dsl.rb

Overview

DSL contains some helper methods to ease the process defining resource proxies

DSL methods are defined under ClassMethods

Defined Under Namespace

Modules: ClassMethods

Constant Summary

PROXY_DIR =

Default directory contains proxy definition files

"omf_rc/resource_proxy"
UTIL_DIR =

Default directory contains utility definition files

"omf_rc/util"
DEFAULT_PROP_ACCESS =

Default property access rights through FRCP

[:configure, :request]

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) included(base)

When this module included, methods defined under ClassMethods will be available in resource definition files



32
33
34
# File 'omf_rc/lib/omf_rc/resource_proxy_dsl.rb', line 32

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

- (Object) call_hook(hook_name, context, *params)

Calling a hook within a given resource context

Parameters:

  • hook_name (Symbol)
  • context (Symbol)

    in which resource this hook will be called



22
23
24
# File 'omf_rc/lib/omf_rc/resource_proxy_dsl.rb', line 22

def call_hook(hook_name, context, *params)
  context.send(hook_name, *params) if context.respond_to? hook_name
end

- (Boolean) hook_defined?(hook_name, context)

Returns:

  • (Boolean)


26
27
28
# File 'omf_rc/lib/omf_rc/resource_proxy_dsl.rb', line 26

def hook_defined?(hook_name, context)
  context.respond_to? hook_name
end