Module: Rack::Component::Methods::InstanceMethods
- Defined in:
- lib/rack/component.rb
Overview
Instances of Rack::Component come with these methods. :reek:ModuleInitialize
Instance Method Summary collapse
-
#env ⇒ Hash
envcan be an empty hash, but cannot be nil. -
#h(obj) ⇒ String
hremoves HTML characters from strings viaCGI.escapeHTML. -
#initialize(env) ⇒ Object
envis Rack::Component’s version of React’spropshash.
Instance Method Details
#env ⇒ Hash
env can be an empty hash, but cannot be nil
43 44 45 |
# File 'lib/rack/component.rb', line 43 def env @env || {} end |
#h(obj) ⇒ String
h removes HTML characters from strings via CGI.escapeHTML.
49 50 51 |
# File 'lib/rack/component.rb', line 49 def h(obj) CGI.escapeHTML(obj.to_s) end |
#initialize(env) ⇒ Object
env is Rack::Component’s version of React’s props hash.
37 38 39 |
# File 'lib/rack/component.rb', line 37 def initialize(env) @env = env end |