Class: Ayadn::UserObject
Instance Attribute Summary collapse
-
#annotations ⇒ Object
Returns the value of attribute annotations.
-
#avatar_image ⇒ Object
Returns the value of attribute avatar_image.
-
#canonical_url ⇒ Object
Returns the value of attribute canonical_url.
-
#counts ⇒ Object
Returns the value of attribute counts.
-
#cover_image ⇒ Object
Returns the value of attribute cover_image.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#follows_you ⇒ Object
Returns the value of attribute follows_you.
-
#id ⇒ Object
Returns the value of attribute id.
-
#input ⇒ Object
Returns the value of attribute input.
-
#is_follower ⇒ Object
Returns the value of attribute is_follower.
-
#is_following ⇒ Object
Returns the value of attribute is_following.
-
#is_muted ⇒ Object
Returns the value of attribute is_muted.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#name ⇒ Object
Returns the value of attribute name.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
-
#type ⇒ Object
Returns the value of attribute type.
-
#username ⇒ Object
Returns the value of attribute username.
-
#verified_domain ⇒ Object
Returns the value of attribute verified_domain.
-
#you_blocked ⇒ Object
Returns the value of attribute you_blocked.
-
#you_can_follow ⇒ Object
Returns the value of attribute you_can_follow.
-
#you_can_subscribe ⇒ Object
Returns the value of attribute you_can_subscribe.
-
#you_follow ⇒ Object
Returns the value of attribute you_follow.
-
#you_muted ⇒ Object
Returns the value of attribute you_muted.
Instance Method Summary collapse
-
#initialize(hash, username = nil) ⇒ UserObject
constructor
A new instance of UserObject.
Constructor Details
#initialize(hash, username = nil) ⇒ UserObject
Returns a new instance of UserObject.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/ayadn/user_object.rb', line 84 def initialize hash, username = nil @input = hash['data'].nil? ? hash : hash['data'] @meta = UserMetaObject.new(hash, username) @you_muted = @input["you_muted"] @you_can_subscribe = @input["you_can_subscribe"] @is_follower = @input["is_follower"] @is_following = @input["is_following"] @timezone = @input["timezone"] @you_follow = @input["you_follow"] @counts = UserCountsObject.new(@input) unless @input.empty? @canonical_url = @input["canonical_url"] @id = @input["id"] @locale = @input["locale"] @type = @input["type"] if !@input["annotations"].nil? @annotations = @input["annotations"].map { |hash| UserAnnotationObject.new(hash) } else @annotations = [] end @username = @input["username"] @avatar_image = AvatarImageObject.new(@input) unless @input.empty? @description = UserDescriptionObject.new(@input) unless @input.empty? @is_muted = @input["is_muted"] @follows_you = @input["follows_you"] @you_can_follow = @input["you_can_follow"] @name = @input["name"].to_s.force_encoding("UTF-8") @created_at = @input["created_at"] @you_blocked = @input["you_blocked"] @cover_image = CoverImageObject.new(@input) unless @input.empty? @verified_domain = @input["verified_domain"] end |
Instance Attribute Details
#annotations ⇒ Object
Returns the value of attribute annotations.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def annotations @annotations end |
#avatar_image ⇒ Object
Returns the value of attribute avatar_image.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def avatar_image @avatar_image end |
#canonical_url ⇒ Object
Returns the value of attribute canonical_url.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def canonical_url @canonical_url end |
#counts ⇒ Object
Returns the value of attribute counts.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def counts @counts end |
#cover_image ⇒ Object
Returns the value of attribute cover_image.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def cover_image @cover_image end |
#created_at ⇒ Object
Returns the value of attribute created_at.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def description @description end |
#follows_you ⇒ Object
Returns the value of attribute follows_you.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def follows_you @follows_you end |
#id ⇒ Object
Returns the value of attribute id.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def id @id end |
#input ⇒ Object
Returns the value of attribute input.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def input @input end |
#is_follower ⇒ Object
Returns the value of attribute is_follower.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def is_follower @is_follower end |
#is_following ⇒ Object
Returns the value of attribute is_following.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def is_following @is_following end |
#is_muted ⇒ Object
Returns the value of attribute is_muted.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def is_muted @is_muted end |
#locale ⇒ Object
Returns the value of attribute locale.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def locale @locale end |
#meta ⇒ Object
Returns the value of attribute meta.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def @meta end |
#name ⇒ Object
Returns the value of attribute name.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def name @name end |
#timezone ⇒ Object
Returns the value of attribute timezone.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def timezone @timezone end |
#type ⇒ Object
Returns the value of attribute type.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def type @type end |
#username ⇒ Object
Returns the value of attribute username.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def username @username end |
#verified_domain ⇒ Object
Returns the value of attribute verified_domain.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def verified_domain @verified_domain end |
#you_blocked ⇒ Object
Returns the value of attribute you_blocked.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def you_blocked @you_blocked end |
#you_can_follow ⇒ Object
Returns the value of attribute you_can_follow.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def you_can_follow @you_can_follow end |
#you_can_subscribe ⇒ Object
Returns the value of attribute you_can_subscribe.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def you_can_subscribe @you_can_subscribe end |
#you_follow ⇒ Object
Returns the value of attribute you_follow.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def you_follow @you_follow end |
#you_muted ⇒ Object
Returns the value of attribute you_muted.
82 83 84 |
# File 'lib/ayadn/user_object.rb', line 82 def you_muted @you_muted end |