Class: ToUser
- Inherits:
-
Object
- Object
- ToUser
- Defined in:
- lib/model/USMF/to_user.rb
Overview
Models the ToUser relation
Instance Attribute Summary collapse
-
#href ⇒ Object
Returns the value of attribute href.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#service ⇒ Object
Returns the value of attribute service.
-
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#to_hash ⇒ Hash
Unify the fields into a hash.
-
#to_s ⇒ String
Resultant string.
Instance Attribute Details
#href ⇒ Object
Returns the value of attribute href.
7 8 9 |
# File 'lib/model/USMF/to_user.rb', line 7 def href @href end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/model/USMF/to_user.rb', line 7 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/model/USMF/to_user.rb', line 7 def name @name end |
#service ⇒ Object
Returns the value of attribute service.
7 8 9 |
# File 'lib/model/USMF/to_user.rb', line 7 def service @service end |
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
7 8 9 |
# File 'lib/model/USMF/to_user.rb', line 7 def thumbnail @thumbnail end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/model/USMF/to_user.rb', line 7 def title @title end |
Instance Method Details
#to_hash ⇒ Hash
Unify the fields into a hash
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/model/USMF/to_user.rb', line 20 def to_hash res = { "name" => name, "id" => id, "service" => service, "title" => title, "thumbnail" => thumbnail, "href" => href } res end |
#to_s ⇒ String
Returns resultant string.
12 13 14 15 |
# File 'lib/model/USMF/to_user.rb', line 12 def to_s res = "\nname: " + name.to_s + "\nid: " + id.to_s + "\nservice: " + service.to_s + "\ntitle: " + title.to_s + "\nthumbnail: " + thumbnail.to_s + "\nhref: " + href.to_s res end |