Module: Card::Set::Type::User

Extended by:
Card::Set
Defined in:
platypus/tmp/set/gem-defaults/mod028-follow/type/user.rb,
platypus/tmp/set/gem-defaults/mod014-account/type/user.rb

Overview

Set: All “User” cards

Defined Under Namespace

Modules: HtmlFormat

Constant Summary

Constants included from Helpers

Helpers::SET_PATTERN_TEST_REGEXP

Constants included from Event::Api

Event::Api::OPTIONS

Instance Attribute Summary collapse

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

Instance Attribute Details

#emailObject

Returns the value of attribute email.



12
13
14
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/user.rb', line 12

def email
  @email
end

Class Method Details

.source_locationObject



7
# File 'platypus/tmp/set/gem-defaults/mod028-follow/type/user.rb', line 7

def self.source_location; "/Users/ethan/dev/decko/gem/mod/follow/set/type/user.rb"; end

Instance Method Details

#event: check_setupObject



57
58
59
60
61
62
63
64
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/user.rb', line 57

event :check_setup, before: :check_permissions, on: :create, trigger: :required do
  abort :failure unless Auth.needs_setup?
  Auth.as_bot
  @setup_approved = true
  # we need bot authority to set the initial administrator roles
  # this is granted and inspected here as a separate event for
  # flexibility and security when configuring initial setups
end

#event: setup_first_userObject



66
67
68
69
70
71
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/user.rb', line 66

event :setup_first_user, :finalize, on: :create, when: :setup? do
  subcard %i[signup_alert_email to].cardname, content: name
  basket[:roles_for_first_user].map(&:cardname).each do |role|
    subcard [role, :members].cardname, content: name
  end
end

#event: signin_after_setupObject



73
74
75
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/user.rb', line 73

event :signin_after_setup, :integrate, on: :create, when: :setup? do
  Auth. id
end

#follow(follow_name, option = "*always") ⇒ Object



8
9
10
11
12
13
14
# File 'platypus/tmp/set/gem-defaults/mod028-follow/type/user.rb', line 8

def follow follow_name, option="*always"
  return unless (follow_rule = Card.fetch(follow_name)&.follow_rule_card(name, new: {}))

  follow_rule.drop_item "*never"
  follow_rule.add_item option
  follow_rule.save!
end