Class: TableColumnComponentPreview

Inherits:
ViewComponent::Preview
  • Object
show all
Defined in:
lib/alveole/previews/table_column_component_preview.rb

Defined Under Namespace

Classes: TempObj

Instance Method Summary collapse

Instance Method Details

#defaultObject



12
13
14
15
# File 'lib/alveole/previews/table_column_component_preview.rb', line 12

def default
  temp_obj = TempObj.new
  render(TableColumnComponent.new(value: nil, obj: temp_obj, fieldname: :fieldname, url: nil, options: {}))
end

#with_custom_valueObject



32
33
34
35
# File 'lib/alveole/previews/table_column_component_preview.rb', line 32

def with_custom_value
  temp_obj = TempObj.new
  render(TableColumnComponent.new(value: 'custom value', obj: temp_obj, fieldname: :fieldname, url: nil, options: {}))
end

#with_dateObject



22
23
24
25
# File 'lib/alveole/previews/table_column_component_preview.rb', line 22

def with_date
  temp_obj = TempObj.new(Time.zone.today)
  render(TableColumnComponent.new(value: nil, obj: temp_obj, fieldname: :fieldname, url: 'example/url', options: { date: true }))
end

#with_timeObject



27
28
29
30
# File 'lib/alveole/previews/table_column_component_preview.rb', line 27

def with_time
  temp_obj = TempObj.new(Time.zone.now)
  render(TableColumnComponent.new(value: nil, obj: temp_obj, fieldname: :fieldname, url: 'example/url', options: { time: true }))
end

#with_urlObject



17
18
19
20
# File 'lib/alveole/previews/table_column_component_preview.rb', line 17

def with_url
  temp_obj = TempObj.new
  render(TableColumnComponent.new(value: nil, obj: temp_obj, fieldname: :fieldname, url: 'example/url', options: {}))
end