class DbMeta::Oracle::ConstraintCollection
Attributes
collection[R]
extract_type[R]
name[R]
status[R]
type[R]
Public Class Methods
new(args = {})
click to toggle source
# File lib/db_meta/oracle/types/constraint_collection.rb, line 8 def initialize(args = {}) @name = args[:name] @type = args[:type] @status = :valid @extract_type = :default @collection = [] end
Public Instance Methods
<<(object)
click to toggle source
# File lib/db_meta/oracle/types/constraint_collection.rb, line 20 def <<(object) @collection << object end
ddl_drop()
click to toggle source
# File lib/db_meta/oracle/types/constraint_collection.rb, line 35 def ddl_drop "-- will automatically be dropped with table object" end
empty?()
click to toggle source
# File lib/db_meta/oracle/types/constraint_collection.rb, line 16 def empty? @collection.size == 0 end
extract(args = {})
click to toggle source
# File lib/db_meta/oracle/types/constraint_collection.rb, line 24 def extract(args = {}) buffer = [block(@name)] title = nil @collection.sort_by { |o| [o.table_name, o.name] }.each do |object| buffer << block(object.table_name, 40) if title != object.table_name buffer << object.extract(args) title = object.table_name end buffer.join("\n") end
system_object?()
click to toggle source
# File lib/db_meta/oracle/types/constraint_collection.rb, line 39 def system_object? false end