Class: Turntabler::Sticker
- Defined in:
- lib/turntabler/sticker.rb
Overview
Represents a virtual sticker that can be placed on a user
Instance Attribute Summary collapse
-
#category ⇒ String
readonly
The type of sticker (such as “laptop_sticker”).
-
#description ⇒ String
readonly
A longer explanation for the sticker.
-
#id ⇒ String
readonly
Allow the id to be set via the “sticker_id” attribute.
-
#name ⇒ String
readonly
The human-readable name for the sticker.
-
#path ⇒ String
readonly
The uri for the sticker.
-
#price ⇒ Fixnum
readonly
The cost to purchase this sticker for use.
-
#state ⇒ String
readonly
Whether this sticker can be used (“active”).
Instance Method Summary collapse
-
#place(top, left, angle) ⇒ true
Sets the current user’s stickers.
Methods inherited from Resource
#==, attribute, #attributes=, #hash, #initialize, #load, #loaded?, #pretty_print, #pretty_print_instance_variables
Methods included from Assertions
#assert_valid_keys, #assert_valid_values
Methods included from DigestHelpers
Constructor Details
This class inherits a constructor from Turntabler::Resource
Instance Attribute Details
#category ⇒ String (readonly)
The type of sticker (such as “laptop_sticker”)
20 |
# File 'lib/turntabler/sticker.rb', line 20 attribute :category |
#description ⇒ String (readonly)
A longer explanation for the sticker
16 |
# File 'lib/turntabler/sticker.rb', line 16 attribute :description |
#id ⇒ String (readonly)
Allow the id to be set via the “sticker_id” attribute
8 |
# File 'lib/turntabler/sticker.rb', line 8 attribute :id, :sticker_id |
#name ⇒ String (readonly)
The human-readable name for the sticker
12 |
# File 'lib/turntabler/sticker.rb', line 12 attribute :name |
#path ⇒ String (readonly)
The uri for the sticker
32 |
# File 'lib/turntabler/sticker.rb', line 32 attribute :path |
#price ⇒ Fixnum (readonly)
The cost to purchase this sticker for use
24 |
# File 'lib/turntabler/sticker.rb', line 24 attribute :price |
#state ⇒ String (readonly)
Whether this sticker can be used (“active”)
28 |
# File 'lib/turntabler/sticker.rb', line 28 attribute :state |
Instance Method Details
#place(top, left, angle) ⇒ true
Sets the current user’s stickers.
43 44 45 46 |
# File 'lib/turntabler/sticker.rb', line 43 def place(top, left, angle) api('sticker.place', :placement => [:sticker_id => id, :top => top, :left => left, :angle => angle], :is_dj => client.user.dj?, :roomid => room.id, :section => room.section) true end |