Class: Pixiv::Member
Defined Under Namespace
Modules: WithClient
Instance Attribute Summary collapse
-
#member_id ⇒ Integer
(also: #id)
readonly
Lazily returns member_id.
-
#name ⇒ String
readonly
Lazily returns name.
-
#pixiv_id ⇒ String
readonly
Lazily returns pixiv_id.
-
#profile_image_url ⇒ String
readonly
Lazily returns profile_image_url.
Class Method Summary collapse
-
.url(member_id) ⇒ String
Returns the URL for given
member_id
.
Instance Method Summary collapse
Methods inherited from Page
#bind, #doc, #fetched?, #force, #initialize, lazy_new
Constructor Details
This class inherits a constructor from Pixiv::Page
Instance Attribute Details
#member_id ⇒ Integer (readonly) Also known as: id
Lazily returns member_id
16 |
# File 'lib/pixiv/member.rb', line 16 lazy_attr_reader(:member_id) { at!('link[hreflang=en]')['href'][%r{/users/(\d+)}, 1].to_i } |
#name ⇒ String (readonly)
Lazily returns name
14 |
# File 'lib/pixiv/member.rb', line 14 lazy_attr_reader(:name) { at!('.profile-unit h1').inner_text } |
#pixiv_id ⇒ String (readonly)
Lazily returns pixiv_id
18 |
# File 'lib/pixiv/member.rb', line 18 lazy_attr_reader(:pixiv_id) { profile_image_url[%r{/profile/([a-z_-]+)/}, 1] } |
#profile_image_url ⇒ String (readonly)
Lazily returns profile_image_url
20 |
# File 'lib/pixiv/member.rb', line 20 lazy_attr_reader(:profile_image_url) { at!('.profile-unit .user-image')['src'] } |
Class Method Details
.url(member_id) ⇒ String
Returns the URL for given member_id
9 10 11 |
# File 'lib/pixiv/member.rb', line 9 def self.url(member_id) "#{ROOT_URL}/member.php?id=#{member_id}" end |
Instance Method Details
#url ⇒ String
26 |
# File 'lib/pixiv/member.rb', line 26 def url; self.class.url(member_id) end |