class Envo::PathVal

Attributes

host[R]
path[RW]

Public Class Methods

new(host, str) click to toggle source
# File lib/envo/val/path_val.rb, line 3
def initialize(host, str)
  @host = host
  @path = str
end

Public Instance Methods

accept_assign?(other) click to toggle source
# File lib/envo/val/path_val.rb, line 13
def accept_assign?(other)
  other.type == type
end
clean!() click to toggle source
# File lib/envo/val/path_val.rb, line 37
def clean!
  @path = nil if @path && !@path.empty? && !@host.path_exists?(@path)
end
invalid_description() click to toggle source
# File lib/envo/val/path_val.rb, line 16
def invalid_description
  @host.path_exists?(@path) ? nil : 'non-existing path'
end
list?() click to toggle source
# File lib/envo/val/path_val.rb, line 19
def list?
  false
end
pretty_print(ctx) click to toggle source
# File lib/envo/val/path_val.rb, line 28
def pretty_print(ctx)
  ctx.puts @path
  inv = invalid_description
  return if !inv
  ctx.warn "Warning: #{inv}"
end
to_env_s() click to toggle source
# File lib/envo/val/path_val.rb, line 34
def to_env_s
  @path
end
to_list() click to toggle source
# File lib/envo/val/path_val.rb, line 22
def to_list
  return PathListVal.new(@host, [@path])
end
to_s() click to toggle source
# File lib/envo/val/path_val.rb, line 25
def to_s
  @path
end
type() click to toggle source

casts

# File lib/envo/val/path_val.rb, line 10
def type
  :path
end