Class: Listings::BaseFieldDescriptor

Inherits:
Object
  • Object
show all
Defined in:
lib/listings/base_field_descriptor.rb

Direct Known Subclasses

ColumnDescriptor, FilterDescriptor

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/listings/base_field_descriptor.rb', line 3

def path
  @path
end

#procObject (readonly)

Returns the value of attribute proc.



5
6
7
# File 'lib/listings/base_field_descriptor.rb', line 5

def proc
  @proc
end

#propsObject (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

Returns:

  • (Boolean)


17
18
19
# File 'lib/listings/base_field_descriptor.rb', line 17

def is_field?
  !path.nil? && !path.is_a?(String)
end