Class: JSONAPIonify::Api::Resource::Builders::AttributeBuilder
- Inherits:
-
BaseBuilder
- Object
- BaseBuilder
- JSONAPIonify::Api::Resource::Builders::AttributeBuilder
- Defined in:
- lib/jsonapionify/api/resource/builders/attribute_builder.rb
Constant Summary collapse
- UnsupportedError =
Class.new(StandardError)
Constants included from Structure
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#example_id ⇒ Object
readonly
Returns the value of attribute example_id.
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
-
#write ⇒ Object
readonly
Returns the value of attribute write.
Attributes inherited from BaseBuilder
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(resource, example_id:, instance:, attribute:, context:, write: false) ⇒ AttributeBuilder
constructor
A new instance of AttributeBuilder.
Methods inherited from BaseBuilder
Constructor Details
#initialize(resource, example_id:, instance:, attribute:, context:, write: false) ⇒ AttributeBuilder
Returns a new instance of AttributeBuilder.
10 11 12 13 14 15 16 17 |
# File 'lib/jsonapionify/api/resource/builders/attribute_builder.rb', line 10 def initialize(resource, example_id:, instance:, attribute:, context:, write: false) super(resource) @instance = instance @context = context @attribute = attribute @write = write @example_id = example_id end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
7 8 9 |
# File 'lib/jsonapionify/api/resource/builders/attribute_builder.rb', line 7 def attribute @attribute end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
7 8 9 |
# File 'lib/jsonapionify/api/resource/builders/attribute_builder.rb', line 7 def context @context end |
#example_id ⇒ Object (readonly)
Returns the value of attribute example_id.
7 8 9 |
# File 'lib/jsonapionify/api/resource/builders/attribute_builder.rb', line 7 def example_id @example_id end |
#instance ⇒ Object (readonly)
Returns the value of attribute instance.
7 8 9 |
# File 'lib/jsonapionify/api/resource/builders/attribute_builder.rb', line 7 def instance @instance end |
#write ⇒ Object (readonly)
Returns the value of attribute write.
7 8 9 |
# File 'lib/jsonapionify/api/resource/builders/attribute_builder.rb', line 7 def write @write end |
Instance Method Details
#build ⇒ Object
19 20 21 |
# File 'lib/jsonapionify/api/resource/builders/attribute_builder.rb', line 19 def build write ? build_writable : build_readable end |