Module: Representable::Binding::Collection

Overview

generics for collection bindings.

Instance Method Summary collapse

Instance Method Details

#skipable_empty_value?(value) ⇒ Boolean

Returns:

  • (Boolean)


110
111
112
113
114
115
# File 'lib/representable/binding.rb', line 110

def skipable_empty_value?(value)
  # TODO: this can be optimized, again.
  return true if value.nil? && !(self[:render_nil]) # FIXME: test this without the "and"

  true if (self[:render_empty] == false) && value && value.empty? # TODO: change in 2.0, don't render emtpy.
end