Class: ForeignKeyChecker::Checkers::Tables::Result
- Inherits:
-
Object
- Object
- ForeignKeyChecker::Checkers::Tables::Result
- Defined in:
- lib/foreign_key_checker/checkers/tables.rb
Instance Attribute Summary collapse
-
#foreign_keys ⇒ Object
readonly
Returns the value of attribute foreign_keys.
-
#internal_references ⇒ Object
readonly
Returns the value of attribute internal_references.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
- #ext_ref? ⇒ Boolean
-
#initialize(**args) ⇒ Result
constructor
A new instance of Result.
- #ok? ⇒ Boolean
- #referenced? ⇒ Boolean
Constructor Details
#initialize(**args) ⇒ Result
Returns a new instance of Result.
46 47 48 49 50 |
# File 'lib/foreign_key_checker/checkers/tables.rb', line 46 def initialize(**args) i[table_name foreign_keys internal_references].each do |key| instance_variable_set("@#{key}", args[key] || args[key].to_s) end end |
Instance Attribute Details
#foreign_keys ⇒ Object (readonly)
Returns the value of attribute foreign_keys.
45 46 47 |
# File 'lib/foreign_key_checker/checkers/tables.rb', line 45 def foreign_keys @foreign_keys end |
#internal_references ⇒ Object (readonly)
Returns the value of attribute internal_references.
45 46 47 |
# File 'lib/foreign_key_checker/checkers/tables.rb', line 45 def internal_references @internal_references end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
45 46 47 |
# File 'lib/foreign_key_checker/checkers/tables.rb', line 45 def table_name @table_name end |
Instance Method Details
#ext_ref? ⇒ Boolean
60 61 62 |
# File 'lib/foreign_key_checker/checkers/tables.rb', line 60 def ext_ref? !internal_references end |
#ok? ⇒ Boolean
52 53 54 |
# File 'lib/foreign_key_checker/checkers/tables.rb', line 52 def ok? foreign_keys.blank? end |
#referenced? ⇒ Boolean
56 57 58 |
# File 'lib/foreign_key_checker/checkers/tables.rb', line 56 def referenced? foreign_keys.present? end |