Module: Card::Set::TypePlusRight::User::Follow

Extended by:
Card::Set
Defined in:
tmpsets/set/mod017-follow/type_plus_right/user/follow.rb,
tmpsets/set/mod017-follow/type_plus_right/user/follow/follow_editor_helper.rb

Overview

Set: All "+Follow" cards on "User" cards

a virtual pointer to the sets that a user is following.

Defined Under Namespace

Modules: FollowEditorHelper, HtmlFormat

Class Method Summary collapse

Instance Method Summary collapse

Methods included from I18nScope

#mod_name, #scope

Methods included from Loader

#clean_empty_module_from_hash, #clean_empty_modules, #extended, #process_base_modules, #register_set

Methods included from Helpers

#abstract_set?, #all_set?, #num_set_parts, #shortname, #underscore

Methods included from AdvancedApi

#attachment, #ensure_set, #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 Basket

#abstract_basket, #add_to_basket, #basket, #unshift_basket

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



8
# File 'tmpsets/set/mod017-follow/type_plus_right/user/follow.rb', line 8

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

Instance Method Details

#current_user?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'tmpsets/set/mod017-follow/type_plus_right/user/follow.rb', line 33

def current_user?
  Auth.signed_in? && Auth.current_id == left.id
end

#item_names(_args = {}) ⇒ Object

overrides pointer default



21
22
23
24
25
26
27
# File 'tmpsets/set/mod017-follow/type_plus_right/user/follow.rb', line 21

def item_names _args={}
  if (user = left)
    Card.preference_names user.name, "follow"
  else
    []
  end
end

#suggestionsObject



29
30
31
# File 'tmpsets/set/mod017-follow/type_plus_right/user/follow.rb', line 29

def suggestions
  Card[:follow_suggestions]&.item_names || []
end

#virtual?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'tmpsets/set/mod017-follow/type_plus_right/user/follow.rb', line 12

def virtual?
  !real?
end