module Motion

Constants

VERSION

Public Class Methods

build_renderer_for(websocket_connection) click to toggle source
# File lib/motion.rb, line 43
def build_renderer_for(websocket_connection)
  config.renderer_for_connection_proc.call(websocket_connection)
end
config() click to toggle source
# File lib/motion.rb, line 29
def config
  @config ||= Configuration.default
end
Also aliased as: configuration
configuration()
Alias for: config
configure(&block) click to toggle source
# File lib/motion.rb, line 23
def configure(&block)
  raise AlreadyConfiguredError if @config

  @config = Configuration.new(&block)
end
markup_transformer() click to toggle source
# File lib/motion.rb, line 39
def markup_transformer
  @markup_transformer ||= MarkupTransformer.new
end
notify_error(error, message) click to toggle source
# File lib/motion.rb, line 47
def notify_error(error, message)
  config.error_notification_proc&.call(error, message)
end
reset_internal_state_for_testing!(new_configuration = nil) click to toggle source

This method only exists for testing. Changing configuration while Motion is in use is not supported. It is only safe to call this method when no components are currently mounted.

# File lib/motion.rb, line 54
def reset_internal_state_for_testing!(new_configuration = nil)
  @config = new_configuration
  @serializer = nil
  @markup_transformer = nil
end
serializer() click to toggle source
# File lib/motion.rb, line 35
def serializer
  @serializer ||= Serializer.new
end