Class: Blueprinter::Field Private
- Inherits:
-
Object
- Object
- Blueprinter::Field
- Defined in:
- lib/blueprinter/field.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #blueprint ⇒ Object readonly private
- #extractor ⇒ Object readonly private
- #method ⇒ Object readonly private
- #name ⇒ Object readonly private
- #options ⇒ Object readonly private
Instance Method Summary collapse
- #extract(object, local_options) ⇒ Object private
-
#initialize(method, name, extractor, blueprint, options = {}) ⇒ Field
constructor
private
A new instance of Field.
- #skip?(object, local_options) ⇒ Boolean private
Constructor Details
#initialize(method, name, extractor, blueprint, options = {}) ⇒ Field
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Field.
4 5 6 7 8 9 10 |
# File 'lib/blueprinter/field.rb', line 4 def initialize(method, name, extractor, blueprint, = {}) @method = method @name = name @extractor = extractor @blueprint = blueprint @options = end |
Instance Attribute Details
#blueprint ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
3 4 5 |
# File 'lib/blueprinter/field.rb', line 3 def blueprint @blueprint end |
#extractor ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
3 4 5 |
# File 'lib/blueprinter/field.rb', line 3 def extractor @extractor end |
#method ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
3 4 5 |
# File 'lib/blueprinter/field.rb', line 3 def method @method end |
#name ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
3 4 5 |
# File 'lib/blueprinter/field.rb', line 3 def name @name end |
#options ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
3 4 5 |
# File 'lib/blueprinter/field.rb', line 3 def @options end |
Instance Method Details
#extract(object, local_options) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/blueprinter/field.rb', line 12 def extract(object, ) extractor.extract(method, object, , ) end |
#skip?(object, local_options) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 19 |
# File 'lib/blueprinter/field.rb', line 16 def skip?(object, ) return true if if_callable && !if_callable.call(object, ) unless_callable && unless_callable.call(object, ) end |