Exception: Suture::Error::InvalidPlan
- Inherits:
-
StandardError
- Object
- StandardError
- Suture::Error::InvalidPlan
- Defined in:
- lib/suture/error/invalid_plan.rb
Constant Summary collapse
- HEADER =
"Suture was unable to create your seam, because options passed to `Suture.create` were invalid."
Class Method Summary collapse
- .conflicting_options(conflicts) ⇒ Object
- .invalid_options(invalids) ⇒ Object
- .missing_requirements(requirements) ⇒ Object
Class Method Details
.conflicting_options(conflicts) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/suture/error/invalid_plan.rb', line 29 def self.(conflicts) new <<-MSG.gsub(/^ {8}/,'') #{HEADER} Suture isn't sure how to best handle the combination of options passed: #{conflicts.map {|| "* #{}" }.join("\n ")} MSG end |
.invalid_options(invalids) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/suture/error/invalid_plan.rb', line 17 def self.(invalids) new <<-MSG.gsub(/^ {8}/,'') #{HEADER} The following options were invalid: #{invalids.map {|(name,rule)| "* #{name.inspect} - #{rule[:]}" }.join("\n ")} MSG end |
.missing_requirements(requirements) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/suture/error/invalid_plan.rb', line 5 def self.missing_requirements(requirements) new <<-MSG.gsub(/^ {8}/,'') #{HEADER} The following options are required: #{requirements.map {|(name,explanation)| "* #{name.inspect} - #{explanation}" }.join("\n ")} MSG end |