module Writer module Fetcher module Microdata class PersonUser attr_accessor :source def initialize the_source @source = the_source end def hash @attributes = @source.attributes resp = { "type" => [ @source._type ], "properties" => { "additionalType" => [ @attributes[:additionalType] ], "Item#id" => [ @attributes[:id] ], "name" => [ @attributes[:name] ], "User#dateRegistered" => [ @attributes[:dateRegistered] ], "description" => [ @attributes[:description] ], "url" => [ @attributes[:url] ] } } resp["properties"].keys.each do |att| if resp["properties"]["#{att}"] == [nil] resp["properties"].delete "#{att}" end end resp end end end end end