Class: React::Router::DSL::TransitionContext
- Inherits:
-
Object
- Object
- React::Router::DSL::TransitionContext
- Defined in:
- lib/react/router/dsl/transition_context.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#next_state ⇒ Object
readonly
Returns the value of attribute next_state.
-
#prev_state ⇒ Object
readonly
Returns the value of attribute prev_state.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ TransitionContext
constructor
A new instance of TransitionContext.
- #promise ⇒ Object
- #replace(url) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ TransitionContext
Returns a new instance of TransitionContext.
5 6 7 8 9 10 |
# File 'lib/react/router/dsl/transition_context.rb', line 5 def initialize(opts = {}) @prev_state = Hash.new opts[:prev_state] @next_state = Hash.new opts[:next_state] @replace = opts[:replace] @location = Hash.new opts[:location] end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
14 15 16 |
# File 'lib/react/router/dsl/transition_context.rb', line 14 def location @location end |
#next_state ⇒ Object (readonly)
Returns the value of attribute next_state.
13 14 15 |
# File 'lib/react/router/dsl/transition_context.rb', line 13 def next_state @next_state end |
#prev_state ⇒ Object (readonly)
Returns the value of attribute prev_state.
12 13 14 |
# File 'lib/react/router/dsl/transition_context.rb', line 12 def prev_state @prev_state end |
Instance Method Details
#promise ⇒ Object
21 22 23 |
# File 'lib/react/router/dsl/transition_context.rb', line 21 def promise @promise ||= Promise.new end |
#replace(url) ⇒ Object
16 17 18 19 |
# File 'lib/react/router/dsl/transition_context.rb', line 16 def replace(url) `#{@replace}(#{url.to_n})` url end |