Class: Rubyang::Database::SchemaTree::BooleanType

Inherits:
Type
  • Object
show all
Defined in:
lib/rubyang/database/schema_tree.rb

Instance Attribute Summary

Attributes inherited from Type

#arg

Instance Method Summary collapse

Constructor Details

#initializeBooleanType

Returns a new instance of BooleanType.



121
122
123
# File 'lib/rubyang/database/schema_tree.rb', line 121

def initialize
  @arg = 'boolean'
end

Instance Method Details

#valid?(value) ⇒ Boolean

Returns:

  • (Boolean)


124
125
126
127
128
129
130
131
132
# File 'lib/rubyang/database/schema_tree.rb', line 124

def valid? value
  if 'true' == value
    true
  elsif 'false' == value
    true
  else
    false
  end
end