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

Extended by:
AbstractFormat
Defined in:
tmpsets/set/mod017-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 'tmpsets/set/mod017-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 'tmpsets/set/mod017-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