class Cwsrb::User

The User class represents a member of ConWorkShop.

Attributes

bio[R]

@return [String] The User's bio, max 1000 characters

country[R]

@return [String] The User's country

gender[R]

@return [String] The User's gender, one of “Male”, “Female”, “Cyborg”

or "Other"
id[R]

@return [String, Integer] The User's ID

karma[R]

@return [Array<(Integer, Integer)>] The User's karma counts; first one

is upvotes and second one is downvotes
name[R]

@return [String] The User's name

Public Class Methods

new(id: '', name: '', gender: 'Other', bio: '', country: 'Unknown', karma: [0, 0]) click to toggle source

Initializes a new User instance with an options hash. @param id [String, Integer] The user's ID: a bunch of numbers that may

or may not be prefixed with 'S'. Defaults to an empty string.

@param name [String] The user's name. Defaults to an empty string. @param gender [String] The user's gender, one of “Male”, “Female”,

"Cyborg" or "Other". Defaults to "Other".

@param bio [String] The user's bio or about section. Defaults to an

empty string.

@param country [String] The user's country. Defaults to “Unknown”. @param karma [Array<(Integer, Integer)>] The user's karma counts.

First is upvotes, second is downvotes. Defaults to zero for both.

@return [User] a new instance of User

# File lib/cwsrb/data.rb, line 38
def initialize(id: '', name: '', gender: 'Other', bio: '', country: 'Unknown', karma: [0, 0])
  @id = id
  @name = name
  @gender = gender
  @bio = bio
  @country = country
  @karma = karma
end

Public Instance Methods

inspect() click to toggle source

@overload inspect

@return [String] A more meaningful output than that of the default
inspect method, with all of User's attributes.
# File lib/cwsrb/data.rb, line 56
def inspect
  "<User id=#{@id} name=#{@name} gender=#{gender} bio=#{bio} country=#{country} karma=#{karma}>"
end