Class: FunkyTabs::TabAction
- Inherits:
-
Object
- Object
- FunkyTabs::TabAction
- Defined in:
- lib/funky_tabs/tab_action.rb
Instance Attribute Summary collapse
-
#content_path ⇒ Object
Returns the value of attribute content_path.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(hash_or_string) ⇒ TabAction
constructor
A new instance of TabAction.
- #set_attrs(attrs_hash) ⇒ Object
Constructor Details
#initialize(hash_or_string) ⇒ TabAction
Returns a new instance of TabAction.
9 10 11 12 13 |
# File 'lib/funky_tabs/tab_action.rb', line 9 def initialize(hash_or_string) return set_attrs({:name=>hash_or_string}) if hash_or_string.is_a?(String) return set_attrs(hash_or_string) if hash_or_string.is_a?(Hash) raise FunkyTabsException.new("invalid action parameters #{hash_or_string.inspect}") end |
Instance Attribute Details
#content_path ⇒ Object
Returns the value of attribute content_path.
7 8 9 |
# File 'lib/funky_tabs/tab_action.rb', line 7 def content_path @content_path end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/funky_tabs/tab_action.rb', line 6 def name @name end |
Instance Method Details
#set_attrs(attrs_hash) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/funky_tabs/tab_action.rb', line 15 def set_attrs(attrs_hash) raise FunkyTabsException.new("invalid action attrs format #{attrs_hash.inspect}") unless attrs_hash.is_a?(Hash) attrs_hash.each do |key,val| self.send("#{key}=",val) end return self end |