Class: SimpleJsonApi::JsonApiWrapper
- Inherits:
-
Object
- Object
- SimpleJsonApi::JsonApiWrapper
- Defined in:
- lib/simple_json_api/json_api_wrapper.rb
Overview
JSONAPI Wrapper
Instance Method Summary collapse
- #as_json(_options = nil) ⇒ Object
-
#initialize(root_node, page) ⇒ JsonApiWrapper
constructor
A new instance of JsonApiWrapper.
Constructor Details
#initialize(root_node, page) ⇒ JsonApiWrapper
Returns a new instance of JsonApiWrapper.
9 10 11 12 13 |
# File 'lib/simple_json_api/json_api_wrapper.rb', line 9 def initialize(root_node, page) @root_node = root_node @page = page @result = {} end |
Instance Method Details
#as_json(_options = nil) ⇒ Object
15 16 17 18 19 |
# File 'lib/simple_json_api/json_api_wrapper.rb', line 15 def as_json( = nil) add_members @result.delete_if { |_, content| content.blank? } @result end |