lib/bolognese/schema_org.rb in bolognese-0.4.2 vs lib/bolognese/schema_org.rb in bolognese-0.4.3
- old
+ new
@@ -77,10 +77,14 @@
def author
Array(metadata.fetch("author", nil)).map { |a| a.except("name") }
end
+ def editor
+ Array(metadata.fetch("editor", nil)).map { |a| a.except("name") }
+ end
+
def description
metadata.fetch("description", nil)
end
def license
@@ -125,10 +129,18 @@
def publisher
metadata.fetch("publisher", nil)
end
+ def container_title
+ if publisher.is_a?(Hash)
+ publisher.fetch("name", nil)
+ elsif publisher.is_a?(String)
+ publisher
+ end
+ end
+
def provider
metadata.fetch("provider", nil)
end
def as_schema_org
@@ -137,9 +149,10 @@
"@id" => id,
"url" => url,
"name" => name,
"alternateName" => alternate_name,
"author" => author,
+ "editor" => editor,
"description" => description,
"license" => license,
"version" => version,
"keywords" => keywords,
"dateCreated" => date_created,