class Spreader::Votes

This class Spreads the Vote response body into different methods.

Attributes

obj[R]

Get raw hash return of the object @return [Hash]

Public Class Methods

new(obj) click to toggle source

Initializes the votes class @param obj [Object] JSON parsed object

# File lib/topgg/votes.rb, line 6
def initialize(obj)
  @obj = obj
end

Public Instance Methods

first() click to toggle source

Get the first vote amongst all the other votes. @return [Spreader::User]

# File lib/topgg/votes.rb, line 16
def first
  Spreader::User.new(@obj[0])
end
total() click to toggle source

Get the total number of votes @return [Integer]

# File lib/topgg/votes.rb, line 22
def total
  @obj.length
end