Module: NeonRAW::Objects::Thing::Gildable

Included in:
Comment, Submission
Defined in:
lib/NeonRAW/objects/thing/gildable.rb

Overview

Methods for things that can be gilded.

Instance Method Summary collapse

Instance Method Details

#gild(quantity) ⇒ Object

Give a thing gold.

Parameters:

  • quantity (Integer)

    The amount of gold to give.



20
21
22
23
24
25
# File 'lib/NeonRAW/objects/thing/gildable.rb', line 20

def gild(quantity)
  quantity.times do
    @client.request_data("/api/v1/gold/gild/#{name}", :post)
  end
  refresh!
end

#gilded?Boolean

Checks whether a comment was gilded or not.

Returns:

  • (Boolean)

    Returns whether or not the comment was gilded.



9
10
11
12
13
14
15
# File 'lib/NeonRAW/objects/thing/gildable.rb', line 9

def gilded?
  if @gilded > 0
    true
  else
    false
  end
end