Class: Leftovers::ConfigLoader::Schema

Inherits:
Object
  • Object
show all
Defined in:
lib/leftovers/config_loader/schema.rb

Class Method Summary collapse

Class Method Details

.===(other) ⇒ Object

leftovers:test_only



21
22
23
24
25
26
27
28
29
# File 'lib/leftovers/config_loader/schema.rb', line 21

def ===(other) # leftovers:test_only
  # :nocov:
  if other.is_a?(::Module)
    self >= other
  else
    other.is_a?(self)
  end
  # :nocov:
end

.error(node, requirement) ⇒ Object



7
8
9
10
11
# File 'lib/leftovers/config_loader/schema.rb', line 7

def error(node, requirement)
  node.error = "#{node.name_}must #{requirement}"

  false
end

.to_ruby(node) ⇒ Object



17
18
19
# File 'lib/leftovers/config_loader/schema.rb', line 17

def to_ruby(node)
  node.to_ruby
end

.validate(node) ⇒ Object



13
14
15
# File 'lib/leftovers/config_loader/schema.rb', line 13

def validate(node)
  node.valid?
end