Class: SE::API::User

Inherits:
Object
  • Object
show all
Defined in:
lib/se/api/types/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item_json) ⇒ User

Returns a new instance of User.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/se/api/types/user.rb', line 6

def initialize(item_json)
  @json = Hash(item_json)
  @accept_rate = @json["accept_rate"]
  @badge_counts = @json["badge_counts"]
  @name = @json["display_name"]
  @link = @json["link"]
  @image = @json["profile_image"]
  @reputation = @json["reputation"]
  @id = @json["user_id"]
  @type = @json["user_type"]
end

Instance Attribute Details

#accept_rateObject (readonly)

Returns the value of attribute accept_rate.



4
5
6
# File 'lib/se/api/types/user.rb', line 4

def accept_rate
  @accept_rate
end

#badge_countsObject (readonly)

Returns the value of attribute badge_counts.



4
5
6
# File 'lib/se/api/types/user.rb', line 4

def badge_counts
  @badge_counts
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/se/api/types/user.rb', line 4

def id
  @id
end

#imageObject (readonly)

Returns the value of attribute image.



4
5
6
# File 'lib/se/api/types/user.rb', line 4

def image
  @image
end

#jsonObject (readonly)

Returns the value of attribute json.



4
5
6
# File 'lib/se/api/types/user.rb', line 4

def json
  @json
end

Returns the value of attribute link.



4
5
6
# File 'lib/se/api/types/user.rb', line 4

def link
  @link
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/se/api/types/user.rb', line 4

def name
  @name
end

#reputationObject (readonly)

Returns the value of attribute reputation.



4
5
6
# File 'lib/se/api/types/user.rb', line 4

def reputation
  @reputation
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/se/api/types/user.rb', line 4

def type
  @type
end