Sha256: fc0612ac77594c80f3af752ce79f1e4ce3c015b155b1fa95526f80877bd512c6
Contents?: true
Size: 731 Bytes
Versions: 17
Compression:
Stored size: 731 Bytes
Contents
module ACTV module Authorable def author @author ||= author_from_reference || author_from_article end def by_line @by_line ||= description_by_type 'articleByLine' end def author_name_from_by_line author_name_regex = /by (.*)/i.match by_line author_name_regex[1].strip if author_name_regex.present? end private def author_from_article ACTV::Author.build_from_article self.to_hash end def author_from_reference if author_reference ACTV.asset(author_reference.id).first end rescue ACTV::Error::NotFound nil end def author_reference references.find { |reference| reference.type == "author" } end end end
Version data entries
17 entries across 17 versions & 1 rubygems