Class: Graft::Xml::Type::Boolean
Overview
Instance Method Summary
collapse
#initialize, #value
Instance Method Details
#convert ⇒ Object
48
49
50
|
# File 'lib/graft/lib/graft/xml/type.rb', line 48
def convert
true_values.include?(@source) ? true : false
end
|
#convertible? ⇒ Boolean
44
45
46
|
# File 'lib/graft/lib/graft/xml/type.rb', line 44
def convertible?
(true_values + false_values).include?(@source)
end
|
#false_values ⇒ Object
40
41
42
|
# File 'lib/graft/lib/graft/xml/type.rb', line 40
def false_values
['false', '0']
end
|
#true_values ⇒ Object
36
37
38
|
# File 'lib/graft/lib/graft/xml/type.rb', line 36
def true_values
['true', '1']
end
|