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

Constructor Details

#initialize(name) ⇒ Cfp_Class

Create a class with name



149
150
151
# File 'lib/libcfenjin/cfp_classes.rb', line 149

def initialize name
	@name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



146
147
148
# File 'lib/libcfenjin/cfp_classes.rb', line 146

def name
  @name
end

Instance Method Details

#add(name) ⇒ Object

Add an attribute - allows adding strings and arrays



154
155
156
157
158
159
160
161
162
# File 'lib/libcfenjin/cfp_classes.rb', line 154

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