Class: User
- Inherits:
-
Object
- Object
- User
- Defined in:
- lib/model/USMF/user.rb
Overview
Models a User into USMF standard
Instance Attribute Summary collapse
-
#avatar ⇒ Object
Returns the value of attribute avatar.
-
#description ⇒ Object
Returns the value of attribute description.
-
#geo ⇒ Object
Returns the value of attribute geo.
-
#id ⇒ Object
Returns the value of attribute id.
-
#language ⇒ Object
Returns the value of attribute language.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#postings ⇒ Object
Returns the value of attribute postings.
-
#profile ⇒ Object
Returns the value of attribute profile.
-
#real_name ⇒ Object
Returns the value of attribute real_name.
-
#subscribers ⇒ Object
Returns the value of attribute subscribers.
-
#subscriptions ⇒ Object
Returns the value of attribute subscriptions.
-
#utc ⇒ Object
Returns the value of attribute utc.
-
#website ⇒ Object
Returns the value of attribute website.
Instance Method Summary collapse
-
#to_hash ⇒ Hash
Unify the fields into a hash.
-
#to_s ⇒ String
Resultant string.
Instance Attribute Details
#avatar ⇒ Object
Returns the value of attribute avatar.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def avatar @avatar end |
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def description @description end |
#geo ⇒ Object
Returns the value of attribute geo.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def geo @geo end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def id @id end |
#language ⇒ Object
Returns the value of attribute language.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def language @language end |
#location ⇒ Object
Returns the value of attribute location.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def name @name end |
#postings ⇒ Object
Returns the value of attribute postings.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def postings @postings end |
#profile ⇒ Object
Returns the value of attribute profile.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def profile @profile end |
#real_name ⇒ Object
Returns the value of attribute real_name.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def real_name @real_name end |
#subscribers ⇒ Object
Returns the value of attribute subscribers.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def subscribers @subscribers end |
#subscriptions ⇒ Object
Returns the value of attribute subscriptions.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def subscriptions @subscriptions end |
#utc ⇒ Object
Returns the value of attribute utc.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def utc @utc end |
#website ⇒ Object
Returns the value of attribute website.
7 8 9 |
# File 'lib/model/USMF/user.rb', line 7 def website @website end |
Instance Method Details
#to_hash ⇒ Hash
Unify the fields into a hash
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/model/USMF/user.rb', line 21 def to_hash res = { "name" => name, "real_name" => real_name, "id" => id, "language" => language, "utc" => utc, "geo" => geo, "description" => description, "avatar" => avatar, "location" => location, "subscribers" => subscribers, "subscriptions" => subscriptions, "postings" => postings, "profile" => profile, "website" => website } res end |
#to_s ⇒ String
Returns resultant string.
13 14 15 16 |
# File 'lib/model/USMF/user.rb', line 13 def to_s res = "\nname: " + name.to_s + "\nreal_name: " + real_name.to_s + "\nid: " + id.to_s + "\nlanguage: " + language.to_s + "\nutc: " + utc.to_s + "\ngeo: " + geo.to_s + "\ndescription: " + description.to_s + "\navatar: " + avatar.to_s + "\nlocation: " + location.to_s + "\nsubscribers: " + subscribers.to_s + "\nsubscriptions: " + subscriptions.to_s + "\npostings: " + postings.to_s + "\nprofile: " + profile.to_s + "\nwebsite: " + website.to_s res end |