Class: Cfruby::Cfp_Class

Inherits:
Array
  • Object
show all
Defined in:
lib/libcfenjin/cfp_classes.rb

Overview

A Cfruby class contains a list of attributes - i.e a class ‘firewall’ may contain a number of hostnames

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Array

#chmod, #chown, #chown_mod, #create, #exec, #install, #mkdir, #uninstall

Constructor Details

#initialize(name) ⇒ Cfp_Class

Create a class with name



154
155
156
# File 'lib/libcfenjin/cfp_classes.rb', line 154

def initialize name
	@name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



151
152
153
# File 'lib/libcfenjin/cfp_classes.rb', line 151

def name
  @name
end

Instance Method Details

#add(name) ⇒ Object

Add an attribute - allows adding strings and arrays



159
160
161
162
163
164
165
166
167
# File 'lib/libcfenjin/cfp_classes.rb', line 159

def add name
	if name.class == 'String'
		push name
	else
		name.each do | n |
			push n
		end
	end
end