Class: Crawlscope::StructuredData::Audit::Entry
- Inherits:
-
Data
- Object
- Data
- Crawlscope::StructuredData::Audit::Entry
- Defined in:
- lib/crawlscope/structured_data/audit.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#fetch_error ⇒ Object
readonly
Returns the value of attribute fetch_error.
-
#skipped_reason ⇒ Object
readonly
Returns the value of attribute skipped_reason.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#structured_items ⇒ Object
readonly
Returns the value of attribute structured_items.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type
6 7 8 |
# File 'lib/crawlscope/structured_data/audit.rb', line 6 def content_type @content_type end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors
6 7 8 |
# File 'lib/crawlscope/structured_data/audit.rb', line 6 def errors @errors end |
#fetch_error ⇒ Object (readonly)
Returns the value of attribute fetch_error
6 7 8 |
# File 'lib/crawlscope/structured_data/audit.rb', line 6 def fetch_error @fetch_error end |
#skipped_reason ⇒ Object (readonly)
Returns the value of attribute skipped_reason
6 7 8 |
# File 'lib/crawlscope/structured_data/audit.rb', line 6 def skipped_reason @skipped_reason end |
#status ⇒ Object (readonly)
Returns the value of attribute status
6 7 8 |
# File 'lib/crawlscope/structured_data/audit.rb', line 6 def status @status end |
#structured_items ⇒ Object (readonly)
Returns the value of attribute structured_items
6 7 8 |
# File 'lib/crawlscope/structured_data/audit.rb', line 6 def structured_items @structured_items end |
#url ⇒ Object (readonly)
Returns the value of attribute url
6 7 8 |
# File 'lib/crawlscope/structured_data/audit.rb', line 6 def url @url end |
Instance Method Details
#json_ld_count ⇒ Object
7 8 9 |
# File 'lib/crawlscope/structured_data/audit.rb', line 7 def json_ld_count structured_items.count { |item| item[:source] == "json-ld" } end |
#microdata_count ⇒ Object
11 12 13 |
# File 'lib/crawlscope/structured_data/audit.rb', line 11 def microdata_count structured_items.count { |item| item[:source] == "microdata" } end |
#ok? ⇒ Boolean
15 16 17 |
# File 'lib/crawlscope/structured_data/audit.rb', line 15 def ok? fetch_error.nil? && errors.empty? end |
#structured_data_found? ⇒ Boolean
19 20 21 |
# File 'lib/crawlscope/structured_data/audit.rb', line 19 def structured_data_found? skipped_reason == "non-html" || structured_items.any? end |