Class: Aesthetic

Inherits:
ApplicationRecord show all
Defined in:
app/models/aesthetic.rb

Overview

This model holds the aesthetic modifications for each game. It allows for customization of select colors, and font.

Raises:

  • (ValidationError)

    if colors is not an array of valid hex colors

Instance Attribute Summary collapse

Instance Attribute Details

#colorsArray<String>

An array of hex color values stored as strings. (eg. “#000000”)

Returns:

  • (Array<String>)

    the current value of colors


10
11
12
# File 'app/models/aesthetic.rb', line 10

def colors
  @colors
end

#fontString

The font style used for text within the game. (eg. “Arial”)

Returns:

  • (String)

    the current value of font


10
11
12
# File 'app/models/aesthetic.rb', line 10

def font
  @font
end

#game_idInteger

The foreign key that references the associated ‘Game` model. (eg. 1)

Returns:

  • (Integer)

    the current value of game_id


10
11
12
# File 'app/models/aesthetic.rb', line 10

def game_id
  @game_id
end

#labelsArray<String>

An array of label names to match colors. (eg. “Background color”)

Returns:

  • (Array<String>)

    the current value of labels


10
11
12
# File 'app/models/aesthetic.rb', line 10

def labels
  @labels
end