0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-25 02:30:28 +01:00
discourse-custom-wizard/lib/custom_wizard/liquid_extensions/first_non_empty.rb
Faizaan Gagan 105fc46774
FEATURE: added liquid based templating (#83)
* FEATURE: added liquid based templating

* templating should be false by default

* added rspec tests for mapper templating

* wrapped templating tests in a context block

* added a custom liquid filter and tests

* ran rubocop on changed files

* DEV: minor variable and naming changes

* minor code formatting

* improved overall structure and tightened spec for custom filter

* added a spec template: false

* define method at the top of spec file

* naming convention

* removed extra space
2021-04-09 11:04:42 +05:30

11 Zeilen
210 B
Ruby

# frozen_string_literal: true
module ::CustomWizard
module LiquidFilter
module FirstNonEmpty
def first_non_empty(*multiple)
multiple.find { |var| var.present? }
end
end
end
end