Module: Card::Set::TypePlusRight::User::Follow::FollowEditorHelper::HtmlFormat

Extended by:
AbstractFormat
Defined in:
card/tmpsets/set/mod025-card-mod-follow/type_plus_right/user/follow/follow_editor_helper.rb,
card/tmpsets/set/mod026-card-mod-follow/type_plus_right/user/follow/follow_editor_helper.rb

Overview

TODO: these object representations are complex enough for their own class

Instance Method Summary collapse

Instance Method Details

#following_rules_and_options(&block) ⇒ Object

constructs hash of rules/options for “Follow” tab



14
15
16
17
18
19
# File 'card/tmpsets/set/mod025-card-mod-follow/type_plus_right/user/follow/follow_editor_helper.rb', line 14

def following_rules_and_options &block
  rule_opt_array = following_rule_options_hash.map do |key, val|
    [(Card.fetch key, new: {}), val]
  end
  rules_and_options_by_set_pattern Hash[rule_opt_array], &block
end

#ignoring_rules_and_options(&block) ⇒ Object

constructs hash of rules/options for “Ignore” tab



22
23
24
25
26
27
# File 'card/tmpsets/set/mod025-card-mod-follow/type_plus_right/user/follow/follow_editor_helper.rb', line 22

def ignoring_rules_and_options &block
  rule_opts_hash = ignore_rules.each_with_object({}) do |rule, hash|
    hash[rule] = [:never.cardname]
  end
  rules_and_options_by_set_pattern rule_opts_hash, &block
end