Class: Turbo::Visit
- Inherits:
-
Object
- Object
- Turbo::Visit
- Defined in:
- lib/turbo/visit/visit.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#bridge ⇒ Object
readonly
Returns the value of attribute bridge.
-
#delegate ⇒ Object
Returns the value of attribute delegate.
-
#hasCachedSnapshot ⇒ Object
readonly
Returns the value of attribute hasCachedSnapshot.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#restorationIdentifier ⇒ Object
Returns the value of attribute restorationIdentifier.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#visitable ⇒ Object
readonly
Returns the value of attribute visitable.
-
#webView ⇒ Object
readonly
Returns the value of attribute webView.
Instance Method Summary collapse
- #cancel ⇒ Object
- #cancelVisit ⇒ Object
- #complete ⇒ Object
- #completeVisit ⇒ Object
- #fail(error) ⇒ Object
- #failVisit ⇒ Object
- #initWithVisitable(visitable, options: options, bridge: bridge) ⇒ Object
- #start ⇒ Object
-
#startVisit ⇒ Object
Hooks for subclasses.
Instance Attribute Details
#bridge ⇒ Object (readonly)
Returns the value of attribute bridge.
4 5 6 |
# File 'lib/turbo/visit/visit.rb', line 4 def bridge @bridge end |
#delegate ⇒ Object
Returns the value of attribute delegate.
3 4 5 |
# File 'lib/turbo/visit/visit.rb', line 3 def delegate @delegate end |
#hasCachedSnapshot ⇒ Object (readonly)
Returns the value of attribute hasCachedSnapshot.
4 5 6 |
# File 'lib/turbo/visit/visit.rb', line 4 def hasCachedSnapshot @hasCachedSnapshot end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
4 5 6 |
# File 'lib/turbo/visit/visit.rb', line 4 def location @location end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/turbo/visit/visit.rb', line 4 def end |
#restorationIdentifier ⇒ Object
Returns the value of attribute restorationIdentifier.
3 4 5 |
# File 'lib/turbo/visit/visit.rb', line 3 def restorationIdentifier @restorationIdentifier end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
4 5 6 |
# File 'lib/turbo/visit/visit.rb', line 4 def state @state end |
#visitable ⇒ Object (readonly)
Returns the value of attribute visitable.
4 5 6 |
# File 'lib/turbo/visit/visit.rb', line 4 def visitable @visitable end |
#webView ⇒ Object (readonly)
Returns the value of attribute webView.
4 5 6 |
# File 'lib/turbo/visit/visit.rb', line 4 def webView @webView end |
Instance Method Details
#cancel ⇒ Object
33 34 35 36 37 38 |
# File 'lib/turbo/visit/visit.rb', line 33 def cancel if state == :started @state = :canceled cancelVisit end end |
#cancelVisit ⇒ Object
61 |
# File 'lib/turbo/visit/visit.rb', line 61 def cancelVisit; end |
#complete ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/turbo/visit/visit.rb', line 40 def complete if state == :started @state = :completed completeVisit delegate.visitDidComplete(self) if delegate delegate.visitDidFinish(self) if delegate end end |
#completeVisit ⇒ Object
62 |
# File 'lib/turbo/visit/visit.rb', line 62 def completeVisit; end |
#fail(error) ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/turbo/visit/visit.rb', line 49 def fail(error) if state == :started @state = :failed delegate.visit(self, requestDidFailWithError: error) if delegate failVisit delegate.visitDidFail(self) if delegate delegate.visitDidFinish(self) if delegate end end |
#failVisit ⇒ Object
63 |
# File 'lib/turbo/visit/visit.rb', line 63 def failVisit; end |
#initWithVisitable(visitable, options: options, bridge: bridge) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/turbo/visit/visit.rb', line 12 def initWithVisitable(visitable, options: , bridge: bridge) raise visitable.visitableURL.inspect if visitable.visitableURL.is_a?(Hash)# TODO raise .inspect unless .is_a?(VisitOptions)# TODO @visitable = visitable @location = visitable.visitableURL = @bridge = bridge @webView = @bridge.webView @state = :initialized @hasCachedSnapshot = false self end |
#start ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/turbo/visit/visit.rb', line 25 def start if state == :initialized delegate.visitWillStart(self) if delegate @state = :started startVisit end end |
#startVisit ⇒ Object
Hooks for subclasses
60 |
# File 'lib/turbo/visit/visit.rb', line 60 def startVisit; end |