module Writer module Fetcher module Microdata class ArticleSmall attr_accessor :source def initialize the_source self.source = the_source end def hash @attributes = @source.attributes { "type" => [@source._type], "properties" => { "additionalType" => [ @attributes[:additionalType] ], "Item#id" => [ @attributes[:id] ], "articleBody" => [ @attributes[:articleBody] ], "author" => [ @attributes[:author].to.hash ], "Item#viewer" => [ @attributes[:viewer].to.hash ], "dateCreated" => [ @attributes[:dateCreated] ], "provider" => @attributes[:provider], "url" => [ @attributes[:url] ] } } end end end end end