Class: PassionView::Actionable::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/passion_view/actionable.rb

Constant Summary collapse

KEYS =
[
  :name, :icon, :path,
  :type, :context, :priority,
  :options
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Action

Returns a new instance of Action.



20
21
22
23
24
25
# File 'lib/passion_view/actionable.rb', line 20

def initialize(attributes)
  attributes.each do |key, value|
    raise unless respond_to?(key)
    send("#{key}=", value)
  end
end

Instance Method Details

#[](key) ⇒ Object



27
28
29
30
31
# File 'lib/passion_view/actionable.rb', line 27

def [](key)
  return unless KEYS.include?(key)

  send(key)
end