class Agave::Local::FieldType::Theme

Attributes

accent_color[R]
dark_color[R]
light_color[R]
primary_color[R]

Public Class Methods

new(logo, primary_color, dark_color, light_color, accent_color, repo) click to toggle source
# File lib/agave/local/field_type/theme.rb, line 18
def initialize(logo, primary_color, dark_color, light_color, accent_color, repo)
  @logo = logo
  @primary_color = primary_color
  @dark_color = dark_color
  @light_color = light_color
  @accent_color = accent_color
  @repo = repo
end
parse(value, repo) click to toggle source
# File lib/agave/local/field_type/theme.rb, line 7
def self.parse(value, repo)
  value && new(
    value[:logo],
    value[:primary_color],
    value[:dark_color],
    value[:light_color],
    value[:accent_color],
    repo
  )
end

Public Instance Methods

to_hash(*args) click to toggle source
# File lib/agave/local/field_type/theme.rb, line 31
def to_hash(*args)
  {
    primary_color: primary_color,
    dark_color: dark_color,
    light_color: light_color,
    accent_color: accent_color,
    logo: logo && logo.to_hash(*args)
  }
end