Class: Stupidedi::Config::EditorConfig
- Inherits:
-
Object
- Object
- Stupidedi::Config::EditorConfig
- Includes:
- Inspect
- Defined in:
- lib/stupidedi/config/editor_config.rb
Instance Method Summary collapse
-
#an?(value) ⇒ Boolean
Is ‘value` a valid string (AN)?.
- #at(definition) ⇒ Object
- #customize(&block) ⇒ Object
- #defined_at?(definition) ⇒ Boolean
-
#enabled?(id) ⇒ Boolean
Is the edit or rewrite rule enabled?.
-
#initialize ⇒ EditorConfig
constructor
A new instance of EditorConfig.
- #pretty_print(q) ⇒ void
- #register(definition, &constructor) ⇒ Object
Methods included from Inspect
Constructor Details
#initialize ⇒ EditorConfig
Returns a new instance of EditorConfig.
10 11 12 |
# File 'lib/stupidedi/config/editor_config.rb', line 10 def initialize @table = Hash.new end |
Instance Method Details
#an?(value) ⇒ Boolean
Is ‘value` a valid string (AN)?
24 25 26 |
# File 'lib/stupidedi/config/editor_config.rb', line 24 def an?(value) true # @todo end |
#at(definition) ⇒ Object
40 41 42 |
# File 'lib/stupidedi/config/editor_config.rb', line 40 def at(definition) (@table.at(definition) || @table.at(definition.class.name)).call end |
#customize(&block) ⇒ Object
14 15 16 |
# File 'lib/stupidedi/config/editor_config.rb', line 14 def customize(&block) tap(&block) end |
#defined_at?(definition) ⇒ Boolean
34 35 36 37 |
# File 'lib/stupidedi/config/editor_config.rb', line 34 def defined_at?(definition) @table.defined_at?(definition) or @table.defined_at?(definition.class.name) end |
#enabled?(id) ⇒ Boolean
Is the edit or rewrite rule enabled?
19 20 21 |
# File 'lib/stupidedi/config/editor_config.rb', line 19 def enabled?(id) true end |
#pretty_print(q) ⇒ void
This method returns an undefined value.
45 46 47 48 49 50 51 |
# File 'lib/stupidedi/config/editor_config.rb', line 45 def pretty_print(q) q.text "EditorConfig" q.group(2, "(", ")") do q.breakable "" # ... end end |
#register(definition, &constructor) ⇒ Object
29 30 31 |
# File 'lib/stupidedi/config/editor_config.rb', line 29 def register(definition, &constructor) @table[definition] = constructor end |