Class: Ravelry::UserSite
- Inherits:
-
Object
- Object
- Ravelry::UserSite
- Defined in:
- lib/ravelry/user_site.rb
Overview
There is no API access point for UserSite. The information used to create ‘Ravelry::UserSite` comes from other objects.
You should not create ‘UserSite` objects manually; they are all created–and owned by–other objects.
This does not inherit from Data because it doesn’t have a corresponding API endpoint.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#social_site ⇒ Object
readonly
Returns the value of attribute social_site.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(user_site) ⇒ UserSite
constructor
Creates new ‘UserSite` from Ravelry API attributes.
Constructor Details
#initialize(user_site) ⇒ UserSite
Creates new ‘UserSite` from Ravelry API attributes.
All class variables are readonly.
15 16 17 18 19 20 |
# File 'lib/ravelry/user_site.rb', line 15 def initialize(user_site) @id = user_site[:id] @social_site = SocialSite.new(user_site[:social_site]) @url = user_site[:url] @username = user_site[:username] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/ravelry/user_site.rb', line 9 def id @id end |
#social_site ⇒ Object (readonly)
Returns the value of attribute social_site.
9 10 11 |
# File 'lib/ravelry/user_site.rb', line 9 def @social_site end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
9 10 11 |
# File 'lib/ravelry/user_site.rb', line 9 def url @url end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
9 10 11 |
# File 'lib/ravelry/user_site.rb', line 9 def username @username end |