Class: OpenGraphElement

Inherits:
HTMLProofer::Element show all
Defined in:
lib/html-proofer/check/opengraph.rb

Constant Summary

Constants included from HTMLProofer::Utils

HTMLProofer::Utils::STORAGE_DIR

Instance Attribute Summary collapse

Attributes inherited from HTMLProofer::Element

#alt, #data_proofer_ignore, #href, #id, #line, #link, #name

Instance Method Summary collapse

Methods inherited from HTMLProofer::Element

#absolute_path, #allow_hash_href?, #base, #check_img_http?, #exists?, #external?, #file_path, #follow_location?, #hash, #ignore?, #ignore_alt?, #ignore_empty_alt?, #ignores_pattern_check, #internal?, #non_http_remote?, #parts, #path, #remote?, #scheme, #unslashed_directory?, #url, #valid?

Methods included from HTMLProofer::Utils

clean_content, create_nokogiri, #pluralize, swap

Constructor Details

#initialize(obj, check) ⇒ OpenGraphElement

Returns a new instance of OpenGraphElement.



6
7
8
9
10
11
12
# File 'lib/html-proofer/check/opengraph.rb', line 6

def initialize(obj, check)
  super(obj, check)
  # Fake up src from the content attribute
  instance_variable_set("@src", @content)
  
  @src.insert 0, 'http:' if @src =~ %r{^//}
end

Instance Attribute Details

#srcObject (readonly)

Returns the value of attribute src.



4
5
6
# File 'lib/html-proofer/check/opengraph.rb', line 4

def src
  @src
end