Class: Tracks::SourceViewSwitching::Responder
- Inherits:
-
Object
- Object
- Tracks::SourceViewSwitching::Responder
show all
- Defined in:
- lib/tracks/source_view_switching.rb
Instance Method Summary
collapse
Constructor Details
#initialize(source_view) ⇒ Responder
Returns a new instance of Responder.
5
6
7
|
# File 'lib/tracks/source_view_switching.rb', line 5
def initialize(source_view)
@source_view = source_view.underscore.gsub(/\s+/, '_').to_sym rescue nil
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(check_source_view, *args) ⇒ Object
17
18
19
|
# File 'lib/tracks/source_view_switching.rb', line 17
def method_missing(check_source_view, *args)
yield if check_source_view == @source_view && block_given?
end
|
Instance Method Details
#context ⇒ Object
13
14
15
|
# File 'lib/tracks/source_view_switching.rb', line 13
def context
yield if :context == @source_view && block_given?
end
|
#nil? ⇒ Boolean
9
10
11
|
# File 'lib/tracks/source_view_switching.rb', line 9
def nil?
yield if @source_view.nil? && block_given?
end
|