Class: Rant::RantVar::Constraints::List

Inherits:
Object
  • Object
show all
Includes:
Constraint
Defined in:
lib/rant/import/var/lists.rb

Instance Method Summary collapse

Instance Method Details

#defaultObject



23
24
25
# File 'lib/rant/import/var/lists.rb', line 23

def default
    []
end

#filter(val) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/rant/import/var/lists.rb', line 16

def filter(val)
    if val.respond_to? :to_ary
	val.to_ary
    else
	raise ConstraintError.new(self, val)
    end
end

#to_sObject



26
27
28
# File 'lib/rant/import/var/lists.rb', line 26

def to_s
    "list (Array)"
end