Module: Rx::Subscription
- Included in:
- AnonymousSubscription, EmptySubscription, SerialSubscription
- Defined in:
- lib/rx/subscriptions/subscription.rb,
lib/rx/subscriptions/subscription.rb
Overview
Provides a set of class methods for creating Disposables.
Class Method Summary collapse
-
.create(&unsubscribe_action) ⇒ Object
Creates a subscription object that invokes the specified action when unsubscribed.
-
.empty ⇒ Object
Gets the subscription that does nothing when unsubscribed.
Instance Method Summary collapse
Class Method Details
.create(&unsubscribe_action) ⇒ Object
Creates a subscription object that invokes the specified action when unsubscribed.
47 48 49 |
# File 'lib/rx/subscriptions/subscription.rb', line 47 def self.create(&unsubscribe_action) AnonymousSubscription.new(&unsubscribe_action) end |
.empty ⇒ Object
Gets the subscription that does nothing when unsubscribed.
52 53 54 |
# File 'lib/rx/subscriptions/subscription.rb', line 52 def self.empty EmptySubscription.instance end |
Instance Method Details
#dispose ⇒ Object
8 9 10 |
# File 'lib/rx/subscriptions/subscription.rb', line 8 def dispose unsubscribe end |