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)


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

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

#match_any?(others) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#to_hashObject



83
84
85
# File 'lib/schema_dev/config.rb', line 83

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