Class: Rack::XMLStylesheet
- Inherits:
-
Object
- Object
- Rack::XMLStylesheet
- Defined in:
- lib/rack/xml_stylesheet.rb,
lib/rack/xml_stylesheet/version.rb
Defined Under Namespace
Modules: Strategy
Constant Summary collapse
- VERSION =
version.gsub(/^v?([^\+]+)\+?\d*$/, '\1')
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, *args) ⇒ XMLStylesheet
constructor
A new instance of XMLStylesheet.
Constructor Details
#initialize(app, *args) ⇒ XMLStylesheet
Returns a new instance of XMLStylesheet.
8 9 10 11 12 |
# File 'lib/rack/xml_stylesheet.rb', line 8 def initialize(app, *args) @app = app @options = args.last.is_a?(Hash) ? args.last : {} @strategy = Strategy::Rails23 end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/rack/xml_stylesheet.rb', line 6 def @options end |
Instance Method Details
#call(env) ⇒ Object
14 15 16 17 18 |
# File 'lib/rack/xml_stylesheet.rb', line 14 def call(env) result = @app.call(env) @strategy.new(result, ).add_processing_instructions result end |