Sha256: 6fe73b3efb50fcbeff6ab9a87f1fdb647ffbc32b20db34be1a19ed0764e2a938

Contents?: true

Size: 372 Bytes

Versions: 8

Compression:

Stored size: 372 Bytes

Contents

# frozen_string_literal: true

module MuchRails; end

# MuchRails::InputValue is a utility module for dealing with input field values.
module MuchRails::InputValue
  def self.strip(value)
    return if value.blank?

    value.to_s.strip.presence
  end

  def self.strip_all(values)
    Array
      .wrap(values)
      .map{ |value| strip(value) }
      .compact
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
much-rails-0.4.3 lib/much-rails/input_value.rb
much-rails-0.4.2 lib/much-rails/input_value.rb
much-rails-0.4.1 lib/much-rails/input_value.rb
much-rails-0.4.0 lib/much-rails/input_value.rb
much-rails-0.3.0 lib/much-rails/input_value.rb
much-rails-0.2.8 lib/much-rails/input_value.rb
much-rails-0.2.7 lib/much-rails/input_value.rb
much-rails-0.2.6 lib/much-rails/input_value.rb