Class: FlexiAdmin::Components::Resources::ListViewComponent::Column

Inherits:
Struct
  • Object
show all
Defined in:
lib/flexi_admin/components/resources/list_view_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attributeObject

Returns the value of attribute attribute

Returns:

  • (Object)

    the current value of attribute



11
12
13
# File 'lib/flexi_admin/components/resources/list_view_component.rb', line 11

def attribute
  @attribute
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



11
12
13
# File 'lib/flexi_admin/components/resources/list_view_component.rb', line 11

def options
  @options
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



11
12
13
# File 'lib/flexi_admin/components/resources/list_view_component.rb', line 11

def value
  @value
end

Instance Method Details

#formatted_value(value) ⇒ Object



28
29
30
# File 'lib/flexi_admin/components/resources/list_view_component.rb', line 28

def formatted_value(value)
  options[:formatter].call(value)
end

#labelObject



16
17
18
# File 'lib/flexi_admin/components/resources/list_view_component.rb', line 16

def label
  options[:label]
end

#sort_byObject



24
25
26
# File 'lib/flexi_admin/components/resources/list_view_component.rb', line 24

def sort_by
  options[:sortable].is_a?(TrueClass) ? attribute : options[:sortable]
end

#sortable?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/flexi_admin/components/resources/list_view_component.rb', line 20

def sortable?
  options.key?(:sortable).present? || false
end

#widthObject



12
13
14
# File 'lib/flexi_admin/components/resources/list_view_component.rb', line 12

def width
  options[:width]
end