class React::Component::History
Public Instance Methods
block(prompt)
click to toggle source
# File lib/react/component/history.rb, line 6 def block(prompt) @native.JS[:props].JS[:history].JS.block(prompt) end
create_href(location)
click to toggle source
# File lib/react/component/history.rb, line 10 def create_href(location) @native.JS[:props].JS[:history].JS.createHref(location) end
go(n)
click to toggle source
# File lib/react/component/history.rb, line 14 def go(n) @native.JS[:props].JS[:history].JS.go(n) end
go_back()
click to toggle source
# File lib/react/component/history.rb, line 18 def go_back @native.JS[:props].JS[:history].JS.goBack() end
go_forward()
click to toggle source
# File lib/react/component/history.rb, line 22 def go_forward @native.JS[:props].JS[:history].JS.goForward() end
listen(&block)
click to toggle source
# File lib/react/component/history.rb, line 38 def listen(&block) fun = nil %x{ fun = function(location, action) { let ruby_location = #{React::Component::Location.new(`{ props: { location: location }}`)} block.$call(ruby_location, action); } } unlisten = @native.JS[:props].JS[:history].JS.listen(fun) -> { unlisten.JS.call() } end
location()
click to toggle source
# File lib/react/component/history.rb, line 50 def location return @location if @location return nil unless @native.JS[:props].JS[:history].JS[:location] if @native.JS[:props].JS[:history].JS[:location].JS[:pathname] @location = React::Component::Location.new(@native) else @native.JS[:props].JS[:history].JS[:location] end end
method_missing(prop, *args, &block)
click to toggle source
# File lib/react/component/history.rb, line 34 def method_missing(prop, *args, &block) @native.JS[:props].JS[:history].JS[prop] end
push(*args)
click to toggle source
# File lib/react/component/history.rb, line 26 def push(*args) @native.JS[:props].JS[:history].JS.push(*args) end
replace(*args)
click to toggle source
# File lib/react/component/history.rb, line 30 def replace(*args) @native.JS[:props].JS[:history].JS.replace(*args) end
to_n()
click to toggle source
# File lib/react/component/history.rb, line 60 def to_n @native.JS[:props].JS[:history] end