Module: Representable::Binding::Collection

Overview

generics for collection bindings.

Instance Method Summary collapse

Instance Method Details

#skipable_empty_value?(value) ⇒ Boolean

Returns:

  • (Boolean)


91
92
93
94
95
# File 'lib/representable/binding.rb', line 91

def skipable_empty_value?(value)
  # TODO: this can be optimized, again.
  return true if value.nil? and not self[:render_nil] # FIXME: test this without the "and"
  return true if self[:render_empty] == false and value and value.size == 0  # TODO: change in 2.0, don't render emtpy.
end