Class: SchemaDev::Config::Tuple

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#activerecordObject

Returns the value of attribute activerecord

Returns:

  • (Object)

    the current value of activerecord



93
94
95
# File 'lib/schema_dev/config.rb', line 93

def activerecord
  @activerecord
end

#dbObject

Returns the value of attribute db

Returns:

  • (Object)

    the current value of db



93
94
95
# File 'lib/schema_dev/config.rb', line 93

def db
  @db
end

#dbversionObject

Returns the value of attribute dbversion

Returns:

  • (Object)

    the current value of dbversion



93
94
95
# File 'lib/schema_dev/config.rb', line 93

def dbversion
  @dbversion
end

#rubyObject

Returns the value of attribute ruby

Returns:

  • (Object)

    the current value of ruby



93
94
95
# File 'lib/schema_dev/config.rb', line 93

def ruby
  @ruby
end

Instance Method Details

#match?(other) ⇒ Boolean

Returns:

  • (Boolean)


94
95
96
97
98
99
100
101
# File 'lib/schema_dev/config.rb', line 94

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

  true
end

#match_any?(others) ⇒ Boolean

Returns:

  • (Boolean)


103
104
105
# File 'lib/schema_dev/config.rb', line 103

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

#to_hashObject



107
108
109
# File 'lib/schema_dev/config.rb', line 107

def to_hash
  to_h.compact.transform_values(&:to_s)
end