Class: Foobara::CommandRegistry::AllowedRule
- Inherits:
-
Object
- Object
- Foobara::CommandRegistry::AllowedRule
- Defined in:
- foobara-0.0.110/projects/command_connectors/src/command_registry/allowed_rule.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#explanation ⇒ Object
Returns the value of attribute explanation.
-
#symbol ⇒ Object
Returns the value of attribute symbol.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(symbol: nil, explanation: nil, &block) ⇒ AllowedRule
constructor
A new instance of AllowedRule.
- #to_proc ⇒ Object
Constructor Details
#initialize(symbol: nil, explanation: nil, &block) ⇒ AllowedRule
Returns a new instance of AllowedRule.
18 19 20 21 22 |
# File 'foobara-0.0.110/projects/command_connectors/src/command_registry/allowed_rule.rb', line 18 def initialize(symbol: nil, explanation: nil, &block) self.symbol = symbol self.block = block self.explanation = explanation || symbol end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
16 17 18 |
# File 'foobara-0.0.110/projects/command_connectors/src/command_registry/allowed_rule.rb', line 16 def block @block end |
#explanation ⇒ Object
Returns the value of attribute explanation.
16 17 18 |
# File 'foobara-0.0.110/projects/command_connectors/src/command_registry/allowed_rule.rb', line 16 def explanation @explanation end |
#symbol ⇒ Object
Returns the value of attribute symbol.
16 17 18 |
# File 'foobara-0.0.110/projects/command_connectors/src/command_registry/allowed_rule.rb', line 16 def symbol @symbol end |
Class Method Details
.allowed_rule_attributes_type ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'foobara-0.0.110/projects/command_connectors/src/command_registry/allowed_rule.rb', line 6 def allowed_rule_attributes_type @allowed_rule_attributes_type ||= GlobalDomain.( symbol: :symbol, # TODO: add a function type and a way to union two types so that we can string or function type checking explanation: :duck, logic: :duck ) end |
Instance Method Details
#to_proc ⇒ Object
24 25 26 |
# File 'foobara-0.0.110/projects/command_connectors/src/command_registry/allowed_rule.rb', line 24 def to_proc block end |