Sha256: 829c220048b62f43088b63dafcaa1451fa07ca835350e320288b548ed1ab5919

Contents?: true

Size: 253 Bytes

Versions: 1

Compression:

Stored size: 253 Bytes

Contents

class Object
  # Aim is to convert the object into:
  #  * A hash or
  #  * An array of hashes
  def to_js
    if respond_to?(:attribute_hash)
      attribute_hash
    elsif respond_to?(:attributes)
      attributes
    else
      self
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bowline-0.6.2 lib/bowline/ext/object.rb