Module: Ui::Actionable

Included in:
Card, DescriptiveList, Empty, List, Notification, PageHeader, Table
Defined in:
lib/ui/actionable.rb

Instance Method Summary collapse

Instance Method Details

#actionsObject



3
4
5
6
7
8
9
# File 'lib/ui/actionable.rb', line 3

def actions
  render_group(
    options.fetch(:actions, Array.new).map do |action|
      action.call(model)
    end
  )
end

#actions_lengthObject



11
12
13
# File 'lib/ui/actionable.rb', line 11

def actions_length
  options.fetch(:actions, Array.new).size
end

#has_actions?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/ui/actionable.rb', line 15

def has_actions?
  options.fetch(:actions, []).any?
end