Class: Skeptic::RuleTable
- Inherits:
-
Object
- Object
- Skeptic::RuleTable
- Defined in:
- lib/skeptic/rule_table.rb
Instance Method Summary collapse
- #each_rule ⇒ Object
-
#initialize ⇒ RuleTable
constructor
A new instance of RuleTable.
- #register(klass, option_type) ⇒ Object
- #rules ⇒ Object
- #slugs ⇒ Object
Constructor Details
#initialize ⇒ RuleTable
Returns a new instance of RuleTable.
3 4 5 |
# File 'lib/skeptic/rule_table.rb', line 3 def initialize @rules = {} end |
Instance Method Details
#each_rule ⇒ Object
19 20 21 22 23 |
# File 'lib/skeptic/rule_table.rb', line 19 def each_rule @rules.each do |klass, option_type| yield klass, slug_for(klass), option_type, description_for(klass) end end |
#register(klass, option_type) ⇒ Object
11 12 13 |
# File 'lib/skeptic/rule_table.rb', line 11 def register(klass, option_type) @rules[klass] = option_type end |
#rules ⇒ Object
7 8 9 |
# File 'lib/skeptic/rule_table.rb', line 7 def rules @rules.keys end |
#slugs ⇒ Object
15 16 17 |
# File 'lib/skeptic/rule_table.rb', line 15 def slugs @rules.keys.map { |klass| slug_for klass } end |