Module: EtcdTools::EtcdERB::Erb

Defined in:
lib/etcd-tools/etcd_erb/erb.rb

Instance Method Summary collapse

Instance Method Details

#keys(path) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/etcd-tools/etcd_erb/erb.rb', line 12

def keys path
  path.sub!(/^\//, '')
  if @etcd.get('/' + path).directory?
    return @etcd.get('/' + path).children.map { |key| key.key }
  else
    return []
  end
end

#resultObject



4
5
6
# File 'lib/etcd-tools/etcd_erb/erb.rb', line 4

def result
  super binding
end

#templateObject



21
22
23
# File 'lib/etcd-tools/etcd_erb/erb.rb', line 21

def template
  ARGF.read
end

#value(path) ⇒ Object



8
9
10
# File 'lib/etcd-tools/etcd_erb/erb.rb', line 8

def value path
  return @etcd.get('/' + path.sub(/^\//, '')).value
end