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.



9
10
11
# File 'lib/stupidedi/config/editor_config.rb', line 9

def initialize
  @table = Hash.new
end

Instance Method Details

#an?(value) ⇒ Boolean

Is value a valid string (AN)?

Returns:

  • (Boolean)


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

def an?(value)
  true # @todo
end

#at(definition)

Parameters:

  • definition (Class)


39
40
41
# File 'lib/stupidedi/config/editor_config.rb', line 39

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

#customize(&block)



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

def customize(&block)
  tap(&block)
end

#defined_at?(definition) ⇒ Boolean

Parameters:

  • definition (Class)

Returns:

  • (Boolean)


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

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)


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

def enabled?(id)
  true
end

#pretty_print(q)

This method returns an undefined value.



44
45
46
47
48
49
50
# File 'lib/stupidedi/config/editor_config.rb', line 44

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

#register(definition, &constructor)

Parameters:

  • definition (Class, String)


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

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