Class: Wonderfl::User
- Inherits:
-
Object
- Object
- Wonderfl::User
- Defined in:
- lib/wonderfl/user.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#external_url ⇒ Object
readonly
Returns the value of attribute external_url.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(payload) ⇒ User
constructor
A new instance of User.
- #to_s ⇒ Object
Constructor Details
#initialize(payload) ⇒ User
Returns a new instance of User.
4 5 6 7 8 9 10 |
# File 'lib/wonderfl/user.rb', line 4 def initialize(payload) raise TypeError, 'Hash argument expected' unless payload.is_a? Hash @icon = payload['icon'] @external_url = payload['external_url'] @name = payload['name'] @description = payload['description'] end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
2 3 4 |
# File 'lib/wonderfl/user.rb', line 2 def description @description end |
#external_url ⇒ Object (readonly)
Returns the value of attribute external_url.
2 3 4 |
# File 'lib/wonderfl/user.rb', line 2 def external_url @external_url end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
2 3 4 |
# File 'lib/wonderfl/user.rb', line 2 def icon @icon end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/wonderfl/user.rb', line 2 def name @name end |
Instance Method Details
#to_s ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/wonderfl/user.rb', line 12 def to_s "Wonderfl::User {\nicon => \#{@icon}\nexternal_url => \#{@external_url}\nname => \#{@name}\ndescription => \#{@description}\n}\n EOS\nend\n" |