Class: SchemaDev::Config::Tuple

Inherits:
Object
  • Object
show all
Defined in:
lib/schema_dev/config.rb

Instance Method Summary collapse

Instance Method Details

#match?(other) ⇒ Boolean

Returns:

  • (Boolean)


68
69
70
71
72
73
# File 'lib/schema_dev/config.rb', line 68

def match?(other)
  return false if self.ruby and other.ruby and self.ruby != other.ruby
  return false if self.rails and other.rails and self.rails != other.rails
  return false if self.db and other.db and self.db != other.db
  true
end

#match_any?(others) ⇒ Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/schema_dev/config.rb', line 75

def match_any?(others)
  others.any?{|other| self.match? other}
end

#to_hashObject



79
80
81
# File 'lib/schema_dev/config.rb', line 79

def to_hash
  super.reject{ |k, val| val.nil? }
end