Class: Ravelry::UserSite

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id.



9
10
11
# File 'lib/ravelry/user_site.rb', line 9

def id
  @id
end

#social_siteObject (readonly)

Returns the value of attribute social_site.



9
10
11
# File 'lib/ravelry/user_site.rb', line 9

def social_site
  @social_site
end

#urlObject (readonly)

Returns the value of attribute url.



9
10
11
# File 'lib/ravelry/user_site.rb', line 9

def url
  @url
end

#usernameObject (readonly)

Returns the value of attribute username.



9
10
11
# File 'lib/ravelry/user_site.rb', line 9

def username
  @username
end