lib/fetcher/microdata/twitter/article_small.rb in fetcher-microdata-twitter-0.0.1 vs lib/fetcher/microdata/twitter/article_small.rb in fetcher-microdata-twitter-0.0.2

- old
+ new

@@ -9,24 +9,26 @@ attribute :additionalType attribute :id attribute :articleBody attribute :author + attribute :viewer attribute :dateCreated attribute :provider attribute :url - def initialize original_tweet + def initialize original_tweet, viewer @_type = 'http://schema.org/Article/Small' @additionalType = 'http://getfetcher.net/Item' - coerce original_tweet + coerce original_tweet, viewer end - def coerce original_tweet + def coerce original_tweet, viewer @id = original_tweet["id"] @articleBody = original_tweet["text"] @author = PersonUser.new original_tweet["user"] + @viewer = PersonUser.new viewer @dateCreated = Service.instance.created_at_to_timestamp original_tweet["created_at"] @provider = ["twitter", original_tweet["source"]] @url = "https://twitter.com/#{original_tweet["user"]["screen_name"]}/status/#{original_tweet["id"]}" end end \ No newline at end of file