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.



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

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.



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

def template
  @template
end

#template_apply_restraintObject

Returns the value of attribute template_apply_restraint.



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

def template_apply_restraint
  @template_apply_restraint
end

#template_create_restraintsObject

Returns the value of attribute template_create_restraints.



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

def template_create_restraints
  @template_create_restraints
end

Instance Method Details

#apply_restraint(*ress) ⇒ Object



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

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

#create_restraints(*ress) ⇒ Object



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

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

#make_structObject



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

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