module Rack::Component::Methods::InstanceMethods
Instances of Rack::Component
come with these methods. :reek: ModuleInitialize
Public Class Methods
new(env)
click to toggle source
env
is Rack::Component's version of React's props
hash.
# File lib/rack/component.rb, line 37 def initialize(env) @env = env end
Public Instance Methods
env()
click to toggle source
env
can be an empty hash, but cannot be nil @return [Hash]
# File lib/rack/component.rb, line 43 def env @env || {} end
h(obj)
click to toggle source
h
removes HTML characters from strings via CGI.escapeHTML
. @return [String]
# File lib/rack/component.rb, line 49 def h(obj) CGI.escapeHTML(obj.to_s) end