Class: Openname::User
- Inherits:
-
Object
- Object
- Openname::User
- Defined in:
- lib/openname.rb
Instance Attribute Summary collapse
-
#angellist_username ⇒ Object
readonly
Returns the value of attribute angellist_username.
-
#avatar_url ⇒ Object
readonly
Returns the value of attribute avatar_url.
-
#bio ⇒ Object
readonly
Returns the value of attribute bio.
-
#bitcoin_address ⇒ Object
readonly
Returns the value of attribute bitcoin_address.
-
#bitcoinotc_username ⇒ Object
readonly
Returns the value of attribute bitcoinotc_username.
-
#bitmessage_address ⇒ Object
readonly
Returns the value of attribute bitmessage_address.
-
#cover_url ⇒ Object
readonly
Returns the value of attribute cover_url.
-
#facebook_username ⇒ Object
readonly
Returns the value of attribute facebook_username.
-
#github_username ⇒ Object
readonly
Returns the value of attribute github_username.
-
#instagram_username ⇒ Object
readonly
Returns the value of attribute instagram_username.
-
#linkedin_url ⇒ Object
readonly
Returns the value of attribute linkedin_url.
-
#location_formatted ⇒ Object
readonly
Returns the value of attribute location_formatted.
-
#name_formatted ⇒ Object
readonly
Returns the value of attribute name_formatted.
-
#orgs ⇒ Object
readonly
Returns the value of attribute orgs.
-
#pgp_fingerprint ⇒ Object
readonly
Returns the value of attribute pgp_fingerprint.
-
#pgp_url ⇒ Object
readonly
Returns the value of attribute pgp_url.
-
#schema_version ⇒ Object
readonly
Returns the value of attribute schema_version.
-
#twitter_username ⇒ Object
readonly
Returns the value of attribute twitter_username.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
-
#website ⇒ Object
readonly
Returns the value of attribute website.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(json, username) ⇒ User
constructor
A new instance of User.
- #openname ⇒ Object
Constructor Details
#initialize(json, username) ⇒ User
Returns a new instance of User.
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/openname.rb', line 177 def initialize(json,username) if(json["profile"]) json = json["profile"] end @username = username @name_formatted = json["name"]["formatted"] if json["name"] @avatar_url = json["avatar"]["url"] if json["avatar"] @cover_url = json["cover"]["url"] if json["cover"] @location_formatted = json["location"]["formatted"] if json["location"] @website = json["website"] @bio = json["bio"] @angellist_username = json["angellist"]["username"] if json["angellist"] @github_username = json["github"]["username"] if json["github"] @facebook_username = json["facebook"]["username"] if json["facebook"] @twitter_username = json["twitter"]["username"] if json["twitter"] @instagram_username = json["instagram"]["username"] if json["instagram"] @linkedin_url = json["linkedin"]["url"] if json["linkedin"] @bitcoin_address = json["bitcoin"]["address"] if json["bitcoin"] @bitmessage_address = json["bitmessage"]["address"] if json["bitmessage"] @bitcoinotc_username = json["bitcoinotc"]["username"] if json["bitcoinotc"] @pgp_fingerprint = json["pgp"]["fingerprint"] if json["pgp"] @pgp_url = json["pgp"]["url"] if json["pgp"] @schema_version = json["v"] @orgs = parse_orgs(json["orgs"]) end |
Instance Attribute Details
#angellist_username ⇒ Object (readonly)
Returns the value of attribute angellist_username.
162 163 164 |
# File 'lib/openname.rb', line 162 def angellist_username @angellist_username end |
#avatar_url ⇒ Object (readonly)
Returns the value of attribute avatar_url.
157 158 159 |
# File 'lib/openname.rb', line 157 def avatar_url @avatar_url end |
#bio ⇒ Object (readonly)
Returns the value of attribute bio.
161 162 163 |
# File 'lib/openname.rb', line 161 def bio @bio end |
#bitcoin_address ⇒ Object (readonly)
Returns the value of attribute bitcoin_address.
168 169 170 |
# File 'lib/openname.rb', line 168 def bitcoin_address @bitcoin_address end |
#bitcoinotc_username ⇒ Object (readonly)
Returns the value of attribute bitcoinotc_username.
170 171 172 |
# File 'lib/openname.rb', line 170 def bitcoinotc_username @bitcoinotc_username end |
#bitmessage_address ⇒ Object (readonly)
Returns the value of attribute bitmessage_address.
169 170 171 |
# File 'lib/openname.rb', line 169 def @bitmessage_address end |
#cover_url ⇒ Object (readonly)
Returns the value of attribute cover_url.
158 159 160 |
# File 'lib/openname.rb', line 158 def cover_url @cover_url end |
#facebook_username ⇒ Object (readonly)
Returns the value of attribute facebook_username.
164 165 166 |
# File 'lib/openname.rb', line 164 def facebook_username @facebook_username end |
#github_username ⇒ Object (readonly)
Returns the value of attribute github_username.
163 164 165 |
# File 'lib/openname.rb', line 163 def github_username @github_username end |
#instagram_username ⇒ Object (readonly)
Returns the value of attribute instagram_username.
166 167 168 |
# File 'lib/openname.rb', line 166 def instagram_username @instagram_username end |
#linkedin_url ⇒ Object (readonly)
Returns the value of attribute linkedin_url.
167 168 169 |
# File 'lib/openname.rb', line 167 def linkedin_url @linkedin_url end |
#location_formatted ⇒ Object (readonly)
Returns the value of attribute location_formatted.
159 160 161 |
# File 'lib/openname.rb', line 159 def location_formatted @location_formatted end |
#name_formatted ⇒ Object (readonly)
Returns the value of attribute name_formatted.
156 157 158 |
# File 'lib/openname.rb', line 156 def name_formatted @name_formatted end |
#orgs ⇒ Object (readonly)
Returns the value of attribute orgs.
173 174 175 |
# File 'lib/openname.rb', line 173 def orgs @orgs end |
#pgp_fingerprint ⇒ Object (readonly)
Returns the value of attribute pgp_fingerprint.
171 172 173 |
# File 'lib/openname.rb', line 171 def pgp_fingerprint @pgp_fingerprint end |
#pgp_url ⇒ Object (readonly)
Returns the value of attribute pgp_url.
172 173 174 |
# File 'lib/openname.rb', line 172 def pgp_url @pgp_url end |
#schema_version ⇒ Object (readonly)
Returns the value of attribute schema_version.
174 175 176 |
# File 'lib/openname.rb', line 174 def schema_version @schema_version end |
#twitter_username ⇒ Object (readonly)
Returns the value of attribute twitter_username.
165 166 167 |
# File 'lib/openname.rb', line 165 def twitter_username @twitter_username end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
155 156 157 |
# File 'lib/openname.rb', line 155 def username @username end |
#website ⇒ Object (readonly)
Returns the value of attribute website.
160 161 162 |
# File 'lib/openname.rb', line 160 def website @website end |
Class Method Details
Instance Method Details
#openname ⇒ Object
206 207 208 209 |
# File 'lib/openname.rb', line 206 def openname warn "[DEPRECATION] `openname` is deprecated. Please use `username` instead." username end |