Class: FlagSettings
- Inherits:
-
Object
- Object
- FlagSettings
- Defined in:
- lib/flag_settings.rb
Instance Attribute Summary collapse
-
#additional_message_types ⇒ Object
readonly
Returns the value of attribute additional_message_types.
-
#auto_action_types ⇒ Object
readonly
Returns the value of attribute auto_action_types.
-
#notify_types ⇒ Object
readonly
Returns the value of attribute notify_types.
-
#topic_flag_types ⇒ Object
readonly
Returns the value of attribute topic_flag_types.
-
#without_additional_message_types ⇒ Object
readonly
Returns the value of attribute without_additional_message_types.
Instance Method Summary collapse
- #add(id, name_key, topic_type: nil, notify_type: nil, auto_action_type: nil, require_message: nil, name: nil) ⇒ Object
- #flag_types ⇒ Object
-
#initialize ⇒ FlagSettings
constructor
A new instance of FlagSettings.
- #is_flag?(key) ⇒ Boolean
Constructor Details
#initialize ⇒ FlagSettings
Returns a new instance of FlagSettings.
13 14 15 16 17 18 19 20 21 |
# File 'lib/flag_settings.rb', line 13 def initialize @all_flag_types = Enum.new @topic_flag_types = Enum.new @notify_types = Enum.new @auto_action_types = Enum.new @additional_message_types = Enum.new @without_additional_message_types = Enum.new @names = Enum.new end |
Instance Attribute Details
#additional_message_types ⇒ Object (readonly)
Returns the value of attribute additional_message_types.
4 5 6 |
# File 'lib/flag_settings.rb', line 4 def @additional_message_types end |
#auto_action_types ⇒ Object (readonly)
Returns the value of attribute auto_action_types.
4 5 6 |
# File 'lib/flag_settings.rb', line 4 def auto_action_types @auto_action_types end |
#notify_types ⇒ Object (readonly)
Returns the value of attribute notify_types.
4 5 6 |
# File 'lib/flag_settings.rb', line 4 def notify_types @notify_types end |
#topic_flag_types ⇒ Object (readonly)
Returns the value of attribute topic_flag_types.
4 5 6 |
# File 'lib/flag_settings.rb', line 4 def topic_flag_types @topic_flag_types end |
#without_additional_message_types ⇒ Object (readonly)
Returns the value of attribute without_additional_message_types.
4 5 6 |
# File 'lib/flag_settings.rb', line 4 def @without_additional_message_types end |
Instance Method Details
#add(id, name_key, topic_type: nil, notify_type: nil, auto_action_type: nil, require_message: nil, name: nil) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/flag_settings.rb', line 23 def add( id, name_key, topic_type: nil, notify_type: nil, auto_action_type: nil, require_message: nil, name: nil ) @all_flag_types[name_key] = id @topic_flag_types[name_key] = id if !!topic_type @notify_types[name_key] = id if !!notify_type @auto_action_types[name_key] = id if !!auto_action_type @names[id] = name if name if !! @additional_message_types[name_key] = id else @without_additional_message_types[name_key] = id end end |
#flag_types ⇒ Object
49 50 51 |
# File 'lib/flag_settings.rb', line 49 def flag_types @all_flag_types end |
#is_flag?(key) ⇒ Boolean
45 46 47 |
# File 'lib/flag_settings.rb', line 45 def is_flag?(key) @all_flag_types.valid?(key) end |