Class: Rex::Struct2::CStructTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/struct2/c_struct_template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*tem) ⇒ CStructTemplate

Returns a new instance of CStructTemplate.



15
16
17
18
19
# File 'lib/rex/struct2/c_struct_template.rb', line 15

def initialize(*tem)
	self.template = tem
	self.template_create_restraints = [ ]
	self.template_apply_restraint = [ ]
end

Instance Attribute Details

#templateObject

Returns the value of attribute template.



12
13
14
# File 'lib/rex/struct2/c_struct_template.rb', line 12

def template
  @template
end

#template_apply_restraintObject

Returns the value of attribute template_apply_restraint.



12
13
14
# File 'lib/rex/struct2/c_struct_template.rb', line 12

def template_apply_restraint
  @template_apply_restraint
end

#template_create_restraintsObject

Returns the value of attribute template_create_restraints.



12
13
14
# File 'lib/rex/struct2/c_struct_template.rb', line 12

def template_create_restraints
  @template_create_restraints
end

Instance Method Details

#apply_restraint(*ress) ⇒ Object



26
27
28
29
# File 'lib/rex/struct2/c_struct_template.rb', line 26

def apply_restraint(*ress)
	self.template_apply_restraint = ress
	return self
end

#create_restraints(*ress) ⇒ Object



21
22
23
24
# File 'lib/rex/struct2/c_struct_template.rb', line 21

def create_restraints(*ress)
	self.template_create_restraints = ress
	return self
end

#make_structObject



31
32
33
34
35
# File 'lib/rex/struct2/c_struct_template.rb', line 31

def make_struct
	Rex::Struct2::CStruct.new(*self.template).
	  create_restraints(*self.template_create_restraints).
	  apply_restraint(*self.template_apply_restraint)
end