Module: Squib::WarnUnexpectedParams
- Included in:
- DSL::Background, DSL::Circle, DSL::Csv, DSL::Curve, DSL::CutZone, DSL::Ellipse, DSL::Grid, DSL::Hand, DSL::Line, DSL::PNG, DSL::Polygon, DSL::Rect, DSL::SVG, DSL::SafeZone, DSL::SavePDF, DSL::SavePNG, DSL::SaveSheet, DSL::Showcase, DSL::Star, DSL::Text, DSL::Triangle, DSL::Xlsx, DSL::Yaml, TextEmbed
- Defined in:
- lib/squib/errors_warnings/warn_unexpected_params.rb
Instance Method Summary collapse
Instance Method Details
#warn_if_unexpected(opts, uplevel: 5) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/squib/errors_warnings/warn_unexpected_params.rb', line 6 def warn_if_unexpected(opts, uplevel: 5) accepted_params = self.class.accepted_params unexpected = opts.keys - accepted_params unexpected.each do |key| warn "Unexpected parameter '#{key.to_s.yellow}:' to #{dsl_method.to_s.cyan}(). Accepted parameters: #{accepted_params}", uplevel: uplevel end end |