Class: RussianHill
- Inherits:
-
Object
- Object
- RussianHill
- Includes:
- CableReady::Broadcaster
- Defined in:
- lib/russian_hill.rb,
lib/russian_hill/railtie.rb,
lib/russian_hill/version.rb,
lib/russian_hill/dependency_tracker.rb
Defined Under Namespace
Modules: DependencyTrackerMethods Classes: Railtie
Constant Summary collapse
- VERSION =
'0.1.0'
- DependencyTracker =
Class.new(dependency_tracker::ERBTracker)
Class Method Summary collapse
-
.encode(*args, &block) ⇒ Object
Yields a builder and automatically turns the result into a JSON string.
Instance Method Summary collapse
-
#initialize(context) {|_self| ... } ⇒ RussianHill
constructor
A new instance of RussianHill.
- #method_missing(symbol, *args) ⇒ Object
- #target! ⇒ Object
Constructor Details
#initialize(context) {|_self| ... } ⇒ RussianHill
Returns a new instance of RussianHill.
6 7 8 9 10 |
# File 'lib/russian_hill.rb', line 6 def initialize(context) @context = context @operations = cable_car yield self if ::Kernel.block_given? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args) ⇒ Object
21 22 23 |
# File 'lib/russian_hill.rb', line 21 def method_missing symbol, *args @operations = @operations.public_send(symbol, *args) end |
Class Method Details
.encode(*args, &block) ⇒ Object
Yields a builder and automatically turns the result into a JSON string
13 14 15 |
# File 'lib/russian_hill.rb', line 13 def self.encode(*args, &block) new(*args, &block).target! end |
Instance Method Details
#target! ⇒ Object
17 18 19 |
# File 'lib/russian_hill.rb', line 17 def target! @operations.dispatch.to_json end |