Class: PrettyApi::Parameters::NestedAttributes
- Inherits:
-
Object
- Object
- PrettyApi::Parameters::NestedAttributes
- Defined in:
- lib/pretty_api/parameters/nested_attributes.rb
Instance Method Summary collapse
-
#initialize(nested_tree:) ⇒ NestedAttributes
constructor
A new instance of NestedAttributes.
- #parse(record, params) ⇒ Object
Constructor Details
#initialize(nested_tree:) ⇒ NestedAttributes
Returns a new instance of NestedAttributes.
4 5 6 |
# File 'lib/pretty_api/parameters/nested_attributes.rb', line 4 def initialize(nested_tree:) @nested_tree = nested_tree end |
Instance Method Details
#parse(record, params) ⇒ Object
8 9 10 11 12 |
# File 'lib/pretty_api/parameters/nested_attributes.rb', line 8 def parse(record, params) return params if nested_tree[record.class].blank? parse_nested_attributes(record, params, nested_tree[record.class]) end |