Class: Stupidedi::Config::EditorConfig

Inherits:
Object
  • Object
show all
Includes:
Inspect
Defined in:
lib/stupidedi/config/editor_config.rb

Instance Method Summary collapse

Methods included from Inspect

#inspect

Constructor Details

#initializeEditorConfig

Returns a new instance of EditorConfig.



7
8
9
# File 'lib/stupidedi/config/editor_config.rb', line 7

def initialize
  @table = Hash.new
end

Instance Method Details

#an?(value) ⇒ Boolean

Is ‘value` a valid string (AN)?

Returns:

  • (Boolean)


19
20
21
# File 'lib/stupidedi/config/editor_config.rb', line 19

def an?(value)
  true # @todo
end

#at(definition) ⇒ Object

Parameters:

  • definition (Class)


35
36
37
# File 'lib/stupidedi/config/editor_config.rb', line 35

def at(definition)
  (@table.at(definition) || @table.at(definition.class.name)).call
end

#defined_at?(definition) ⇒ Boolean

Parameters:

  • definition (Class)

Returns:

  • (Boolean)


29
30
31
32
# File 'lib/stupidedi/config/editor_config.rb', line 29

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?

Returns:

  • (Boolean)


14
15
16
# File 'lib/stupidedi/config/editor_config.rb', line 14

def enabled?(id)
  true
end

#pretty_print(q) ⇒ void

This method returns an undefined value.



40
41
42
43
44
45
46
# File 'lib/stupidedi/config/editor_config.rb', line 40

def pretty_print(q)
  q.text "EditorConfig"
  q.group(2, "(", ")") do
    q.breakable ""
    # ...
  end
end

#register(definition, &constructor) ⇒ Object

Parameters:



24
25
26
# File 'lib/stupidedi/config/editor_config.rb', line 24

def register(definition, &constructor)
  @table[definition] = constructor
end