Class: PassionView::Actionable::Action
- Inherits:
-
Object
- Object
- PassionView::Actionable::Action
- Defined in:
- lib/passion_view/actionable.rb
Constant Summary collapse
- KEYS =
[ :name, :icon, :path, :type, :context, :priority, :options ].freeze
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(attributes) ⇒ Action
constructor
A new instance of Action.
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 |