Class: Listings::BaseFieldDescriptor
- Inherits:
-
Object
- Object
- Listings::BaseFieldDescriptor
- Defined in:
- lib/listings/base_field_descriptor.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#proc ⇒ Object
readonly
Returns the value of attribute proc.
-
#props ⇒ Object
readonly
Returns the value of attribute props.
Instance Method Summary collapse
- #build_field(listing) ⇒ Object
-
#initialize(path, props, proc) ⇒ BaseFieldDescriptor
constructor
A new instance of BaseFieldDescriptor.
- #is_field? ⇒ Boolean
Constructor Details
#initialize(path, props, proc) ⇒ BaseFieldDescriptor
Returns a new instance of BaseFieldDescriptor.
7 8 9 10 11 |
# File 'lib/listings/base_field_descriptor.rb', line 7 def initialize(path, props, proc) @path = path @props = props @proc = proc end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/listings/base_field_descriptor.rb', line 3 def path @path end |
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
5 6 7 |
# File 'lib/listings/base_field_descriptor.rb', line 5 def proc @proc end |
#props ⇒ Object (readonly)
Returns the value of attribute props.
4 5 6 |
# File 'lib/listings/base_field_descriptor.rb', line 4 def props @props end |
Instance Method Details
#build_field(listing) ⇒ Object
13 14 15 |
# File 'lib/listings/base_field_descriptor.rb', line 13 def build_field(listing) listing.data_source.build_field(path) end |
#is_field? ⇒ Boolean
17 18 19 |
# File 'lib/listings/base_field_descriptor.rb', line 17 def is_field? !path.nil? && !path.is_a?(String) end |