Class: SiteChecker::Link
- Inherits:
-
Object
- Object
- SiteChecker::Link
- Defined in:
- lib/site_checker/link.rb
Instance Attribute Summary collapse
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#location ⇒ Object
Returns the value of attribute location.
-
#modified_url ⇒ Object
Returns the value of attribute modified_url.
-
#parent_url ⇒ Object
Returns the value of attribute parent_url.
-
#problem ⇒ Object
Returns the value of attribute problem.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #anchor? ⇒ Boolean
- #anchor_ref? ⇒ Boolean
- #anchor_related? ⇒ Boolean
- #eql?(other) ⇒ Boolean
- #has_problem? ⇒ Boolean
- #hash ⇒ Object
- #local_image? ⇒ Boolean
- #local_page? ⇒ Boolean
Instance Attribute Details
#kind ⇒ Object
Returns the value of attribute kind.
6 7 8 |
# File 'lib/site_checker/link.rb', line 6 def kind @kind end |
#location ⇒ Object
Returns the value of attribute location.
7 8 9 |
# File 'lib/site_checker/link.rb', line 7 def location @location end |
#modified_url ⇒ Object
Returns the value of attribute modified_url.
4 5 6 |
# File 'lib/site_checker/link.rb', line 4 def modified_url @modified_url end |
#parent_url ⇒ Object
Returns the value of attribute parent_url.
5 6 7 |
# File 'lib/site_checker/link.rb', line 5 def parent_url @parent_url end |
#problem ⇒ Object
Returns the value of attribute problem.
8 9 10 |
# File 'lib/site_checker/link.rb', line 8 def problem @problem end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/site_checker/link.rb', line 3 def url @url end |
Class Method Details
.create(attrs) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/site_checker/link.rb', line 22 def self.create(attrs) link = Link.new attrs.each do |key, value| if self.instance_methods.map{|m| m.to_s}.include?("#{key}=") eval("link.#{key}=value") end end link end |
Instance Method Details
#==(other) ⇒ Object
14 15 16 |
# File 'lib/site_checker/link.rb', line 14 def ==(other) eql?(other) end |
#anchor? ⇒ Boolean
54 55 56 |
# File 'lib/site_checker/link.rb', line 54 def anchor? @kind == :anchor end |
#anchor_ref? ⇒ Boolean
58 59 60 |
# File 'lib/site_checker/link.rb', line 58 def anchor_ref? @kind == :anchor_ref end |
#anchor_related? ⇒ Boolean
62 63 64 |
# File 'lib/site_checker/link.rb', line 62 def anchor? || anchor_ref? end |
#eql?(other) ⇒ Boolean
10 11 12 |
# File 'lib/site_checker/link.rb', line 10 def eql?(other) @modified_url.eql? other.modified_url end |
#has_problem? ⇒ Boolean
42 43 44 |
# File 'lib/site_checker/link.rb', line 42 def has_problem? @problem != nil end |
#hash ⇒ Object
18 19 20 |
# File 'lib/site_checker/link.rb', line 18 def hash @modified_url.hash end |
#local_image? ⇒ Boolean
50 51 52 |
# File 'lib/site_checker/link.rb', line 50 def local_image? @location == :local && @kind == :image end |
#local_page? ⇒ Boolean
46 47 48 |
# File 'lib/site_checker/link.rb', line 46 def local_page? @location == :local && @kind == :page end |