Sha256: 790e84fb95ce508769a4aa4544ab297e6bcd3bb1ca10f5d87c60343f222fe827

Contents?: true

Size: 273 Bytes

Versions: 5

Compression:

Stored size: 273 Bytes

Contents

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bowline-0.9.4 lib/bowline/ext/object.rb
bowline-0.9.3 lib/bowline/ext/object.rb
bowline-0.9.2 lib/bowline/ext/object.rb
bowline-0.9.1 lib/bowline/ext/object.rb
bowline-0.6.3 lib/bowline/ext/object.rb