Exception: Mokio::Exceptions::IsNotMenuRootError
- Inherits:
-
MokioError
- Object
- StandardError
- MokioError
- Mokio::Exceptions::IsNotMenuRootError
- Defined in:
- lib/mokio/exceptions.rb
Overview
Exception used when specified menu object wasn’t root
Instance Attribute Summary collapse
-
#id ⇒ Object
Given id if type == :id.
-
#name ⇒ Object
Given name if type == :name.
-
#type ⇒ Object
How you search for root.
Attributes inherited from MokioError
Instance Method Summary collapse
-
#initialize(type = :id, arg = nil) ⇒ IsNotMenuRootError
constructor
Constructs a IsNotMenuRootError exception.
-
#obj ⇒ Object
Retruns Mokio::Menu object for id or name given to exception.
Methods inherited from MokioError
Constructor Details
#initialize(type = :id, arg = nil) ⇒ IsNotMenuRootError
Constructs a IsNotMenuRootError exception
Attributes
-
type
- How you search for root -
arg
- Searching argument
52 53 54 55 56 57 58 |
# File 'lib/mokio/exceptions.rb', line 52 def initialize(type = :id, arg = nil) @type = type @message = "Cannot find Menu root for #{type.to_s} = #{arg}" @id = arg if type == :id @name = arg if type == :name end |
Instance Attribute Details
#id ⇒ Object
Given id if type == :id
36 37 38 |
# File 'lib/mokio/exceptions.rb', line 36 def id @id end |
#name ⇒ Object
Given name if type == :name
39 40 41 |
# File 'lib/mokio/exceptions.rb', line 39 def name @name end |
#type ⇒ Object
How you search for root
42 43 44 |
# File 'lib/mokio/exceptions.rb', line 42 def type @type end |