Class: Lotus::Author
- Inherits:
-
Object
- Object
- Lotus::Author
- Defined in:
- lib/lotus/author.rb
Overview
Holds information about the author of the Feed.
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Holds a hash representing information about an account held by this contact.
-
#address ⇒ Object
readonly
Holds a hash representing the address of the contact.
-
#anniversary ⇒ Object
readonly
Holds a DateTime representing a contact’s anniversary.
-
#birthday ⇒ Object
readonly
Holds a DateTime representing this contact’s birthday.
-
#display_name ⇒ Object
readonly
Holds the display name for this contact.
-
#email ⇒ Object
readonly
The email address of the author.
-
#extended_name ⇒ Object
readonly
Holds a hash representing information about the name of this contact.
-
#gender ⇒ Object
readonly
Holds the gender of this contact.
-
#id ⇒ Object
readonly
Holds the id that represents this contact.
-
#name ⇒ Object
readonly
The name of the author.
-
#nickname ⇒ Object
readonly
Holds the nickname of this contact.
-
#note ⇒ Object
readonly
Holds a note for this contact.
-
#organization ⇒ Object
readonly
Holds a hash representing an organization for this contact.
-
#preferred_username ⇒ Object
readonly
Holds the preferred username of this contact.
-
#published ⇒ Object
readonly
Holds a DateTime that represents when this contact was originally published.
-
#updated ⇒ Object
readonly
Holds a DateTime that represents when this contact was last modified.
-
#uri ⇒ Object
readonly
The uri that uniquely identifies the author.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Author
constructor
Creates a representating of an author.
- #to_hash ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Author
Creates a representating of an author.
options:
name => The name of the author. Defaults: "anonymous"
id => The identifier that uniquely identifies the
contact.
nickname => The nickname of the contact.
gender => The gender of the contact.
note => A note for this contact.
display_name => The display name for this contact.
preferred_username => The preferred username for this contact.
updated => A DateTime representing when this contact was
last updated.
published => A DateTime representing when this contact was
originally created.
birthday => A DateTime representing a birthday for this
contact.
anniversary => A DateTime representing an anniversary for this
contact.
extended_name => A Hash representing the name of the contact.
organization => A Hash representing the organization of which the
contact belongs.
account => A Hash describing the authorative account for the
author.
address => A Hash describing the address of the contact.
uri => The uri that uniquely identifies this author.
email => The email of the author.
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/lotus/author.rb', line 130 def initialize( = {}) @uri = [:uri] @name = [:name] || "anonymous" @email = [:email] @id = [:id] @name = [:name] @gender = [:gender] @note = [:note] @nickname = [:nickname] @display_name = [:display_name] @preferred_username = [:preferred_username] @updated = [:updated] @published = [:published] @birthday = [:birthday] @anniversary = [:anniversary] @extended_name = [:extended_name] @organization = [:organization] @account = [:account] @address = [:address] end |
Instance Attribute Details
#account ⇒ Object (readonly)
Holds a hash representing information about an account held by this contact.
contains one or more of the following:
:domain => The top-most authoriative domain for this account. (e.g.
"twitter.com") This is the primary field. Is required.
Used for sorting.
:username => An alphanumeric username, typically chosen by the user.
:userid => A user id, typically assigned, that uniquely refers to
the user.
76 77 78 |
# File 'lib/lotus/author.rb', line 76 def account @account end |
#address ⇒ Object (readonly)
Holds a hash representing the address of the contact.
contains one or more of the following:
:formatted => A formatted representating of the address. May
contain newlines.
:street_address => The full street address. May contain newlines.
:locality => The city or locality component.
:region => The state or region component.
:postal_code => The zipcode or postal code component.
:country => The country name component.
46 47 48 |
# File 'lib/lotus/author.rb', line 46 def address @address end |
#anniversary ⇒ Object (readonly)
Holds a DateTime representing a contact’s anniversary.
101 102 103 |
# File 'lib/lotus/author.rb', line 101 def anniversary @anniversary end |
#birthday ⇒ Object (readonly)
Holds a DateTime representing this contact’s birthday.
98 99 100 |
# File 'lib/lotus/author.rb', line 98 def birthday @birthday end |
#display_name ⇒ Object (readonly)
Holds the display name for this contact.
85 86 87 |
# File 'lib/lotus/author.rb', line 85 def display_name @display_name end |
#email ⇒ Object (readonly)
The email address of the author.
31 32 33 |
# File 'lib/lotus/author.rb', line 31 def email @email end |
#extended_name ⇒ Object (readonly)
Holds a hash representing information about the name of this contact.
contains one or more of the following:
:formatted => The full name of the contact
:family_name => The family name. "Last name" in Western contexts.
:given_name => The given name. "First name" in Western contexts.
:middle_name => The middle name.
:honorific_prefix => "Title" in Western contexts. (e.g. "Mr." "Mrs.")
:honorific_suffix => "Suffix" in Western contexts. (e.g. "Esq.")
25 26 27 |
# File 'lib/lotus/author.rb', line 25 def extended_name @extended_name end |
#gender ⇒ Object (readonly)
Holds the gender of this contact.
79 80 81 |
# File 'lib/lotus/author.rb', line 79 def gender @gender end |
#id ⇒ Object (readonly)
Holds the id that represents this contact.
11 12 13 |
# File 'lib/lotus/author.rb', line 11 def id @id end |
#name ⇒ Object (readonly)
The name of the author
34 35 36 |
# File 'lib/lotus/author.rb', line 34 def name @name end |
#nickname ⇒ Object (readonly)
Holds the nickname of this contact.
14 15 16 |
# File 'lib/lotus/author.rb', line 14 def nickname @nickname end |
#note ⇒ Object (readonly)
Holds a note for this contact.
82 83 84 |
# File 'lib/lotus/author.rb', line 82 def note @note end |
#organization ⇒ Object (readonly)
Holds a hash representing an organization for this contact.
contains one or more of the following:
:name => The name of the organization (e.g. company, school,
etc) This field is required. Will be used for sorting.
:department => The department within the organization.
:title => The title or role within the organization.
:type => The type of organization. Canonical values include
"job" or "school"
:start_date => A DateTime representing when the contact joined
the organization.
:end_date => A DateTime representing when the contact left the
organization.
:location => The physical location of this organization.
:description => A free-text description of the role this contact
played in this organization.
64 65 66 |
# File 'lib/lotus/author.rb', line 64 def organization @organization end |
#preferred_username ⇒ Object (readonly)
Holds the preferred username of this contact.
88 89 90 |
# File 'lib/lotus/author.rb', line 88 def preferred_username @preferred_username end |
#published ⇒ Object (readonly)
Holds a DateTime that represents when this contact was originally published.
95 96 97 |
# File 'lib/lotus/author.rb', line 95 def published @published end |
#updated ⇒ Object (readonly)
Holds a DateTime that represents when this contact was last modified.
91 92 93 |
# File 'lib/lotus/author.rb', line 91 def updated @updated end |
#uri ⇒ Object (readonly)
The uri that uniquely identifies the author.
28 29 30 |
# File 'lib/lotus/author.rb', line 28 def uri @uri end |
Instance Method Details
#to_hash ⇒ Object
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/lotus/author.rb', line 153 def to_hash { :uri => self.uri, :email => self.email, :name => self.name, :id => self.id, :gender => self.gender, :note => self.note, :nickname => self.nickname, :display_name => self.display_name, :preferred_username => self.preferred_username, :updated => self.updated, :published => self.published, :birthday => self.birthday, :anniversary => self.anniversary, :extended_name => self.extended_name, :organization => self.organization, :account => self.account, :address => self.address } end |