Class: Leftovers::ConfigLoader::TrueSchema

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

Class Method Summary collapse

Methods inherited from Schema

===, error

Class Method Details

.to_ruby(node) ⇒ Object



12
13
14
# File 'lib/leftovers/config_loader/true_schema.rb', line 12

def to_ruby(node)
  node.to_ruby == true || node.to_ruby == 'true'
end

.validate(node) ⇒ Object



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

def validate(node)
  error(node, 'be true') unless to_ruby(node)
  super
end