Sha256: 9b662ace366813006dc507758b816211e55621cfa50f462fc75319f0b0a4fe81

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

module Writer
  module Fetcher
    module Microdata
      module Twitter
        class ArticleSmall
          attr_accessor :source

          def initialize the_source
            @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
                ],
                "dateCreated" => [
                  @attributes[:dateCreated]
                ],
                "provider" => @attributes[:provider],
                "url" => [
                  @attributes[:url]
                ]
              }
            }
          end
        end
      end
    end 
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fetcher-microdata-twitter-0.0.1 lib/writer/fetcher/microdata/twitter/article_small.rb