Class: Leftovers::ConfigLoader::ValueOrObjectSchema

Inherits:
ObjectSchema show all
Defined in:
lib/leftovers/config_loader/value_or_object_schema.rb

Class Attribute Summary collapse

Class Method Summary collapse

Methods inherited from ObjectSchema

attribute, attributes, inherit_attributes_from, require_groups

Methods inherited from Schema

===, error

Class Attribute Details

.or_value_schemaObject

Returns the value of attribute or_value_schema.



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

def or_value_schema
  @or_value_schema
end

Class Method Details

.to_ruby(node) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/leftovers/config_loader/value_or_object_schema.rb', line 17

def to_ruby(node)
  if node.hash?
    super
  else
    or_value_schema.to_ruby(node)
  end
end

.validate(node) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/leftovers/config_loader/value_or_object_schema.rb', line 9

def validate(node)
  if node.hash?
    super(node)
  else
    validate_or_value_schema(node)
  end
end