Class: RarCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_arachni/rar_check.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fields) ⇒ RarCheck

Returns a new instance of RarCheck.



4
5
6
7
8
9
10
# File 'lib/ruby_arachni/rar_check.rb', line 4

def initialize(fields)
  self.name = fields['name']
  self.description = fields['description']
  self.author = fields['author']
  self.version = fields['version']
  self.shortname = fields['shortname']
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



2
3
4
# File 'lib/ruby_arachni/rar_check.rb', line 2

def author
  @author
end

#descriptionObject

Returns the value of attribute description.



2
3
4
# File 'lib/ruby_arachni/rar_check.rb', line 2

def description
  @description
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/ruby_arachni/rar_check.rb', line 2

def name
  @name
end

#shortnameObject

Returns the value of attribute shortname.



2
3
4
# File 'lib/ruby_arachni/rar_check.rb', line 2

def shortname
  @shortname
end

#versionObject

Returns the value of attribute version.



2
3
4
# File 'lib/ruby_arachni/rar_check.rb', line 2

def version
  @version
end

Class Method Details

.parse(check) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ruby_arachni/rar_check.rb', line 13

def parse(check)
  fields = {}
  
  fields['name'] = check.css('name').text
  fields['description'] = check.css('description').text
  fields['author'] = check.css('author').text
  fields['version'] = check.css('version').text
  fields['shortname'] = check.css('shortname').text
  
  RarCheck.new(fields)
end