Class: Fetcher::Microdata::Twitter::PersonUser
- Inherits:
-
Object
- Object
- Fetcher::Microdata::Twitter::PersonUser
- Includes:
- Discoverer::Writer, Virtus
- Defined in:
- lib/fetcher/microdata/twitter/person_user.rb
Instance Attribute Summary collapse
-
#_type ⇒ Object
readonly
Returns the value of attribute _type.
Instance Method Summary collapse
- #coerce(twitter_user) ⇒ Object
-
#initialize(twitter_user) ⇒ PersonUser
constructor
A new instance of PersonUser.
Constructor Details
#initialize(twitter_user) ⇒ PersonUser
Returns a new instance of PersonUser.
17 18 19 20 21 |
# File 'lib/fetcher/microdata/twitter/person_user.rb', line 17 def initialize twitter_user @_type = "http://schema.org/Person/User" coerce twitter_user end |
Instance Attribute Details
#_type ⇒ Object (readonly)
Returns the value of attribute _type.
8 9 10 |
# File 'lib/fetcher/microdata/twitter/person_user.rb', line 8 def _type @_type end |
Instance Method Details
#coerce(twitter_user) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/fetcher/microdata/twitter/person_user.rb', line 23 def coerce twitter_user @additionalType = "http://getfetcher.net/Item" @id = twitter_user["id"] @name = twitter_user["name"] @dateRegistered = Service.instance. twitter_user["created_at"] @description = twitter_user["description"] @url = "https://twitter.com/#{twitter_user["screen_name"]}" end |