Class: Rx::OnNextNotification
- Inherits:
-
Object
- Object
- Rx::OnNextNotification
- Includes:
- Notification
- Defined in:
- lib/rx/core/notification.rb
Overview
Represents an on_next notification to an observer.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#accept(observer) ⇒ Object
Invokes the observer’s method corresponding to the notification.
-
#has_value? ⇒ Boolean
Determines whether this notification has a value.
-
#initialize(value) ⇒ OnNextNotification
constructor
A new instance of OnNextNotification.
- #to_s ⇒ Object
Methods included from Notification
create_on_completed, create_on_error, create_on_next, #on_completed?, #on_error?, #on_next?, #to_observable
Constructor Details
#initialize(value) ⇒ OnNextNotification
Returns a new instance of OnNextNotification.
84 85 86 87 |
# File 'lib/rx/core/notification.rb', line 84 def initialize(value) @value = value @kind = :on_next end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
82 83 84 |
# File 'lib/rx/core/notification.rb', line 82 def value @value end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
94 95 96 |
# File 'lib/rx/core/notification.rb', line 94 def ==(other) other.class == self.class && other.on_next? && value == other.value end |
#accept(observer) ⇒ Object
Invokes the observer’s method corresponding to the notification.
104 105 106 |
# File 'lib/rx/core/notification.rb', line 104 def accept(observer) observer.on_next value end |
#has_value? ⇒ Boolean
Determines whether this notification has a value.
90 91 92 |
# File 'lib/rx/core/notification.rb', line 90 def has_value? true end |
#to_s ⇒ Object
99 100 101 |
# File 'lib/rx/core/notification.rb', line 99 def to_s "on_next(#{value})" end |