Class: Onsi::ParamsParser
- Inherits:
-
Object
- Object
- Onsi::ParamsParser
- Defined in:
- lib/onsi/params_parser.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#included ⇒ Object
readonly
Returns the value of attribute included.
-
#relationships ⇒ Object
readonly
Returns the value of attribute relationships.
Instance Method Summary collapse
-
#initialize(params, attributes, relationships) ⇒ ParamsParser
constructor
A new instance of ParamsParser.
- #parse! ⇒ Object
Constructor Details
#initialize(params, attributes, relationships) ⇒ ParamsParser
Returns a new instance of ParamsParser.
10 11 12 13 14 15 |
# File 'lib/onsi/params_parser.rb', line 10 def initialize(params, attributes, relationships) @data = params.require(:data) @included = params.fetch(:included, []) @attributes = attributes @relationships = relationships end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
7 8 9 |
# File 'lib/onsi/params_parser.rb', line 7 def attributes @attributes end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/onsi/params_parser.rb', line 5 def data @data end |
#included ⇒ Object (readonly)
Returns the value of attribute included.
6 7 8 |
# File 'lib/onsi/params_parser.rb', line 6 def included @included end |
#relationships ⇒ Object (readonly)
Returns the value of attribute relationships.
8 9 10 |
# File 'lib/onsi/params_parser.rb', line 8 def relationships @relationships end |
Instance Method Details
#parse! ⇒ Object
17 18 19 20 |
# File 'lib/onsi/params_parser.rb', line 17 def parse! operation = Onsi::ParamsParseOperation.new(data, attributes, relationships, included) operation.perform end |