Class: WpItem
- Inherits:
-
Object
- Object
- WpItem
- Extended by:
- Findable
- Includes:
- Existable, Infos, Output, Versionable, Vulnerable
- Defined in:
- lib/common/models/wp_item.rb,
lib/common/models/wp_item/infos.rb,
lib/common/models/wp_item/output.rb,
lib/common/models/wp_item/findable.rb,
lib/common/models/wp_item/existable.rb,
lib/common/models/wp_item/vulnerable.rb,
lib/common/models/wp_item/versionable.rb
Direct Known Subclasses
Defined Under Namespace
Modules: Existable, Findable, Infos, Output, Versionable, Vulnerable
Instance Attribute Summary (collapse)
-
- (Object) found_from
Returns the value of attribute found_from.
-
- (Object) name
Returns the value of attribute name.
-
- (Object) path
Returns the value of attribute path.
-
- (Object) version
writeonly
Sets the attribute version.
-
- (Object) wp_content_dir
Returns the value of attribute wp_content_dir.
-
- (Object) wp_plugins_dir
Returns the value of attribute wp_plugins_dir.
Attributes included from Vulnerable
Instance Method Summary (collapse)
- - (Object) <=>(other)
- - (Object) ==(other)
- - (Object) ===(other)
-
- (Array) allowed_options
Make it private ?.
- - (void) forge_uri(target_base_uri)
- - (WpItem) initialize(target_base_uri, options = {}) constructor
- - (void) set_options(options) private
-
- (URI) uri
The uri to the WpItem, with the path if present.
-
- (String) url
The url to the WpItem.
Methods included from Output
Methods included from Infos
#changelog_url, #error_log_url, #has_changelog?, #has_directory_listing?, #has_error_log?, #has_readme?, #readme_url, #url_is_200?
Methods included from Existable
#exists?, #exists_from_response?
Methods included from Vulnerable
Methods included from Versionable
Constructor Details
- (WpItem) initialize(target_base_uri, options = {})
32 33 34 35 36 37 38 39 |
# File 'lib/common/models/wp_item.rb', line 32 def initialize(target_base_uri, = {}) [:wp_content_dir] ||= 'wp-content' [:wp_plugins_dir] ||= [:wp_content_dir] + '/plugins' () forge_uri(target_base_uri) end |
Instance Attribute Details
- (Object) found_from
Returns the value of attribute found_from
4 5 6 |
# File 'lib/common/models/wp_item/findable.rb', line 4 def found_from @found_from end |
- (Object) name
Returns the value of attribute name
20 21 22 |
# File 'lib/common/models/wp_item.rb', line 20 def name @name end |
- (Object) path
Returns the value of attribute path
19 20 21 |
# File 'lib/common/models/wp_item.rb', line 19 def path @path end |
- (Object) version=(value) (writeonly)
Sets the attribute version
4 5 6 |
# File 'lib/common/models/wp_item/versionable.rb', line 4 def version=(value) @version = value end |
- (Object) wp_content_dir
Returns the value of attribute wp_content_dir
20 21 22 |
# File 'lib/common/models/wp_item.rb', line 20 def wp_content_dir @wp_content_dir end |
- (Object) wp_plugins_dir
Returns the value of attribute wp_plugins_dir
20 21 22 |
# File 'lib/common/models/wp_item.rb', line 20 def wp_plugins_dir @wp_plugins_dir end |
Instance Method Details
- (Object) <=>(other)
89 90 91 |
# File 'lib/common/models/wp_item.rb', line 89 def <=>(other) name <=> other.name end |
- (Object) ==(other)
94 95 96 |
# File 'lib/common/models/wp_item.rb', line 94 def ==(other) name === other.name end |
- (Object) ===(other)
99 100 101 |
# File 'lib/common/models/wp_item.rb', line 99 def ===(other) self == other && version === other.version end |
- (Array) allowed_options
Make it private ?
24 25 26 |
# File 'lib/common/models/wp_item.rb', line 24 def [:name, :wp_content_dir, :wp_plugins_dir, :path, :version, :vulns_file] end |
- (void) forge_uri(target_base_uri)
This method returns an undefined value.
62 63 64 |
# File 'lib/common/models/wp_item.rb', line 62 def forge_uri(target_base_uri) @uri = target_base_uri end |
- (void) set_options(options) (private)
This method returns an undefined value.
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/common/models/wp_item.rb', line 44 def () .each do |allowed_option| if .has_key?(allowed_option) method = :#{allowed_option}=" if self.respond_to?(method) self.send(method, [allowed_option]) else raise "#{self.class} does not respond to #{method}" end end end end |
- (URI) uri
The uri to the WpItem, with the path if present
67 68 69 |
# File 'lib/common/models/wp_item.rb', line 67 def uri path ? @uri.merge(path) : @uri end |
- (String) url
The url to the WpItem
72 |
# File 'lib/common/models/wp_item.rb', line 72 def url; uri.to_s end |