Module: Card::Set::Type::BootswatchSkin::Events

Extended by:
Card::Set
Defined in:
platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin/events.rb

Overview

Set: All “BootswatchSkin+Events” cards (Events)

Constant Summary

Constants included from Helpers

Helpers::SET_PATTERN_TEST_REGEXP

Constants included from Event::Api

Event::Api::OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Card::Set

reset

Methods included from I18nScope

#mod_name, #scope

Methods included from Registrar

#extended, #finalize_load, #process_base_modules, #register_set

Methods included from Helpers

#format_module, #format_modules, #method_missing, #modules, #pattern_code, #respond_to_missing?, #set_name_parts, #shortname, #underscored_name

Methods included from AdvancedApi

#assign_type, #attachment, #define_set_from_error, #ensure_set, #setting_opts, #stage_method

Methods included from Format

#before, #format, layout_method_name, #view, view_method_name, view_setting_method_name, wrapper_method_name

Methods included from Inheritance

#include_set, #include_set_formats

Methods included from Card::Set::Trait

#card_accessor, #card_reader, #card_writer, #require_field

Methods included from Event::Api

#event

Class Method Details

.source_locationObject



7
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin/events.rb', line 7

def self.source_location; "/Users/ethan/dev/decko/gem/mod/bootstrap/set/type/bootswatch_skin/events.rb"; end

Instance Method Details

#event: copy_themeObject



18
19
20
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin/events.rb', line 18

event :copy_theme, :prepare_to_store, on: :create do
  initialize_theme
end

#event: initialize_because_of_type_changeObject



9
10
11
12
13
14
15
16
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin/events.rb', line 9

event :initialize_because_of_type_change, :prepare_to_store,
      on: :update, changed: :type do
  self.content = content
  initialize_theme
  if (items = old_skin_items)&.present?
    field :stylesheets, content: items
  end
end

#event: validate_theme_templateObject



22
23
24
25
26
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin/events.rb', line 22

event :validate_theme_template, :validate, on: :create do
  return unless (theme = theme_card) && theme.type_code != :bootswatch_skin

  errors.add :abort, t(:bootstrap_not_valid_theme, theme_name: theme.name)
end