Class: Mv::Core::Services::ShowConstraints
- Inherits:
-
Object
- Object
- Mv::Core::Services::ShowConstraints
- Defined in:
- lib/mv/core/services/show_constraints.rb
Instance Attribute Summary collapse
-
#tables ⇒ Object
readonly
Returns the value of attribute tables.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(tables) ⇒ ShowConstraints
constructor
A new instance of ShowConstraints.
Constructor Details
#initialize(tables) ⇒ ShowConstraints
Returns a new instance of ShowConstraints.
11 12 13 |
# File 'lib/mv/core/services/show_constraints.rb', line 11 def initialize(tables) @tables = tables.present? ? tables : Mv::Core::Db::MigrationValidator.pluck(:table_name) end |
Instance Attribute Details
#tables ⇒ Object (readonly)
Returns the value of attribute tables.
9 10 11 |
# File 'lib/mv/core/services/show_constraints.rb', line 9 def tables @tables end |
Instance Method Details
#execute ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/mv/core/services/show_constraints.rb', line 15 def execute existing_constraints.each do |constraint| say_with_time("#{Mv::Core::Presenter::Constraint::Description.new(constraint.description)}") do constraint.validations.each do |validation| say("#{Mv::Core::Presenter::Validation::Base.new(validation)}") end end end end |