Class: YTools::Path::RootSelector

Inherits:
Selector
  • Object
show all
Defined in:
lib/ytools/path/selectors.rb

Instance Attribute Summary

Attributes inherited from Selector

#subselector

Instance Method Summary collapse

Methods inherited from Selector

#chain, #chained?

Instance Method Details

#select(yaml) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/ytools/path/selectors.rb', line 67

def select(yaml)
  if yaml.is_a?(YTools::YamlObject)
    value = yaml.yroot
    if chained?
      subselector.select(value)
    else
      value
    end
  else
    nil
  end
end