Class: Hatena::Bookmark::Restful::V1::User

Inherits:
Object
  • Object
show all
Includes:
ResponseObject
Defined in:
lib/hatena/bookmark/restful/v1/user.rb

Constant Summary collapse

STRING_PROPERTIES =
[:name]
BOOLEAN_PROPERTIES =
[:plususer, :private, :is_oauth_twitter, :is_oauth_evernote, :is_oauth_facebook, :is_oauth_mixi_check]
PROPERTIES =
STRING_PROPERTIES + BOOLEAN_PROPERTIES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ResponseObject

#==, #[], included, #initialize, #to_hash

Instance Attribute Details

#nameString (readonly)

User’s Hatena ID

Returns:

  • (String)


15
# File 'lib/hatena/bookmark/restful/v1/user.rb', line 15

STRING_PROPERTIES  = [:name]

Instance Method Details

#oauth_evernote?Boolean

Connected with Evernote using OAuth or not

Returns:

  • (Boolean)


39
40
41
42
43
# File 'lib/hatena/bookmark/restful/v1/user.rb', line 39

BOOLEAN_PROPERTIES.each do |prop|
  define_method(prop.to_s.gsub(/^is_/, '')) do
    @attributes.fetch(prop)
  end
end

#oauth_facebook?Boolean

Connected with Facebook using OAuth or not

Returns:

  • (Boolean)


39
40
41
42
43
# File 'lib/hatena/bookmark/restful/v1/user.rb', line 39

BOOLEAN_PROPERTIES.each do |prop|
  define_method(prop.to_s.gsub(/^is_/, '')) do
    @attributes.fetch(prop)
  end
end

#oauth_mixi_check?Boolean

Connected with mixi check using OAuth or not

Returns:

  • (Boolean)


39
40
41
42
43
# File 'lib/hatena/bookmark/restful/v1/user.rb', line 39

BOOLEAN_PROPERTIES.each do |prop|
  define_method(prop.to_s.gsub(/^is_/, '')) do
    @attributes.fetch(prop)
  end
end

#oauth_twitter?Boolean

Connected with Twitter using OAuth or not

Returns:

  • (Boolean)


39
40
41
42
43
# File 'lib/hatena/bookmark/restful/v1/user.rb', line 39

BOOLEAN_PROPERTIES.each do |prop|
  define_method(prop.to_s.gsub(/^is_/, '')) do
    @attributes.fetch(prop)
  end
end

#plususer?Boolean

The user subscribed Hatena Bookmark Plus or not

Returns:

  • (Boolean)


39
40
41
42
43
# File 'lib/hatena/bookmark/restful/v1/user.rb', line 39

BOOLEAN_PROPERTIES.each do |prop|
  define_method(prop.to_s.gsub(/^is_/, '')) do
    @attributes.fetch(prop)
  end
end

#private?Boolean

The user does not share his/her bookmarks with anyone or not

Returns:

  • (Boolean)


39
40
41
42
43
# File 'lib/hatena/bookmark/restful/v1/user.rb', line 39

BOOLEAN_PROPERTIES.each do |prop|
  define_method(prop.to_s.gsub(/^is_/, '')) do
    @attributes.fetch(prop)
  end
end