Class: Envo::PathListVal

Inherits:
ListVal show all
Defined in:
lib/envo/val/path_list_val.rb

Instance Attribute Summary

Attributes inherited from ListVal

#ar

Instance Method Summary collapse

Methods inherited from ListVal

#delete, #delete_at, #insert, #invalid_description, #list?, #pretty_print, #shift, #shift_at, #to_list, #to_s, #uniq!

Constructor Details

#initialize(host, ar) ⇒ PathListVal

Returns a new instance of PathListVal.



3
4
5
6
# File 'lib/envo/val/path_list_val.rb', line 3

def initialize(host, ar)
  super(ar)
  @host = host
end

Instance Method Details

#accept_assign?(other) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/envo/val/path_list_val.rb', line 10

def accept_assign?(other)
  other.type == type
end

#accept_item?(item) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/envo/val/path_list_val.rb', line 13

def accept_item?(item)
  item.type == :path
end

#clean!Object



19
20
21
22
# File 'lib/envo/val/path_list_val.rb', line 19

def clean!
  super
  @ar.select! { |s| @host.path_exists?(s) }
end

#pp_attribs(elem) ⇒ Object



16
17
18
# File 'lib/envo/val/path_list_val.rb', line 16

def pp_attribs(elem)
  super + (@host.path_exists?(elem) ? ' ' : 'N')
end

#typeObject



7
8
9
# File 'lib/envo/val/path_list_val.rb', line 7

def type
  :"path list"
end