class Ayadn::UserObject
Attributes
annotations[RW]
avatar_image[RW]
canonical_url[RW]
counts[RW]
cover_image[RW]
created_at[RW]
description[RW]
follows_you[RW]
id[RW]
input[RW]
is_follower[RW]
is_following[RW]
is_muted[RW]
locale[RW]
meta[RW]
name[RW]
timezone[RW]
type[RW]
username[RW]
verified_domain[RW]
you_blocked[RW]
you_can_follow[RW]
you_can_subscribe[RW]
you_follow[RW]
you_muted[RW]
Public Class Methods
new(hash, username = nil)
click to toggle source
# 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