Class: Ravelry::User
- Inherits:
-
Data
- Object
- Data
- Ravelry::User
show all
- Defined in:
- lib/ravelry/user.rb
Overview
See the documentation for each object’s available methods.
Instance Attribute Summary collapse
Attributes inherited from Data
#data, #id
Instance Method Summary
collapse
Methods inherited from Data
#initialize
Constructor Details
This class inherits a constructor from Ravelry::Data
Instance Attribute Details
#pattern_author ⇒ Object
Returns the value of attribute pattern_author.
58
59
60
|
# File 'lib/ravelry/user.rb', line 58
def pattern_author
@pattern_author
end
|
#user_sites ⇒ Object
Returns the value of attribute user_sites.
58
59
60
|
# File 'lib/ravelry/user.rb', line 58
def user_sites
@user_sites
end
|
Instance Method Details
#_id ⇒ Object
ID from the Ravelry database.
119
120
121
|
# File 'lib/ravelry/user.rb', line 119
def _id
@data[:id]
end
|
#about_me ⇒ Object
69
70
71
|
# File 'lib/ravelry/user.rb', line 69
def about_me
@data[:about_me]
end
|
#about_me_html ⇒ Object
73
74
75
|
# File 'lib/ravelry/user.rb', line 73
def about_me_html
@data[:about_me_html]
end
|
#author ⇒ Object
77
78
79
|
# File 'lib/ravelry/user.rb', line 77
def author
@pattern_author
end
|
#fave_colors ⇒ Object
81
82
83
|
# File 'lib/ravelry/user.rb', line 81
def fave_colors
@data[:fave_colors]
end
|
#fave_curse ⇒ Object
85
86
87
|
# File 'lib/ravelry/user.rb', line 85
def fave_curse
@data[:fave_curse]
end
|
#first_name ⇒ Object
89
90
91
|
# File 'lib/ravelry/user.rb', line 89
def first_name
@data[:first_name]
end
|
#get ⇒ Object
60
61
62
63
64
65
66
67
|
# File 'lib/ravelry/user.rb', line 60
def get
request = Typhoeus::Request.get("https://api.ravelry.com/people/#{@id}.json", userpwd: "#{Ravelry.configuration.access_key}:#{Ravelry.configuration.personal_key}")
result = JSON.parse(request.response_body, {symbolize_names: true})
@data = result[:user]
@pattern_author = Build.author(@data)
@user_sites = Build.user_sites(@data)
self
end
|
#large_photo_url ⇒ Object
93
94
95
|
# File 'lib/ravelry/user.rb', line 93
def large_photo_url
@data[:large_photo_url]
end
|
#location ⇒ Object
97
98
99
|
# File 'lib/ravelry/user.rb', line 97
def location
@data[:location]
end
|
#photo_url ⇒ Object
101
102
103
|
# File 'lib/ravelry/user.rb', line 101
def photo_url
@data[:photo_url]
end
|
#small_photo_url ⇒ Object
105
106
107
|
# File 'lib/ravelry/user.rb', line 105
def small_photo_url
@data[:small_photo_url]
end
|
#tiny_photo_url ⇒ Object
109
110
111
|
# File 'lib/ravelry/user.rb', line 109
def tiny_photo_url
@data[:tiny_photo_url]
end
|
#username ⇒ Object
113
114
115
|
# File 'lib/ravelry/user.rb', line 113
def username
@data[:username]
end
|