Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/restfulx/rx_active_support.rb
Instance Method Summary collapse
-
#to_json(options = {}) ⇒ Object
Serialize array as RestfulX friendly JSON (with metadata).
- #to_json_original ⇒ Object
Instance Method Details
#to_json(options = {}) ⇒ Object
Serialize array as RestfulX friendly JSON (with metadata)
135 136 137 138 |
# File 'lib/restfulx/rx_active_support.rb', line 135 def to_json( = {}) attributes = .delete(:attributes) return (attributes.nil?) ? to_json_original() : "[{#{'metadata'.inspect}: #{attributes.to_json}},#{to_json_original()[1..-1]}]" end |
#to_json_original ⇒ Object
132 |
# File 'lib/restfulx/rx_active_support.rb', line 132 alias_method :to_json_original, :to_json |