Class: Flumtter::Toast
- Inherits:
-
Object
- Object
- Flumtter::Toast
- Defined in:
- lib/flumtter/app/core/toast.rb
Instance Method Summary collapse
-
#initialize(msg) ⇒ Toast
constructor
A new instance of Toast.
- #method_missing(method, *args) ⇒ Object
- #show ⇒ Object
Constructor Details
#initialize(msg) ⇒ Toast
Returns a new instance of Toast.
5 6 7 8 9 10 11 12 |
# File 'lib/flumtter/app/core/toast.rb', line 5 def initialize(msg) @msg = msg = {title: TITLE} if block_given? yield(self) show end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/flumtter/app/core/toast.rb', line 18 def method_missing(method, *args) if args.size == 1 [method] = args.first else super end end |
Instance Method Details
#show ⇒ Object
14 15 16 |
# File 'lib/flumtter/app/core/toast.rb', line 14 def show TerminalNotifier.notify(@msg, ) if Setting[:toast?] end |