Class: ResponseMate::Exporter
- Inherits:
-
Object
- Object
- ResponseMate::Exporter
- Defined in:
- lib/response_mate/exporter.rb
Overview
Responsible for exporting response_mate manifest to formats understood by other similar tools
Instance Attribute Summary collapse
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#format ⇒ Object
Returns the value of attribute format.
-
#handler ⇒ Object
Returns the value of attribute handler.
-
#manifest ⇒ Object
Returns the value of attribute manifest.
-
#resource ⇒ Object
Returns the value of attribute resource.
Instance Method Summary collapse
-
#export ⇒ Object
Returns the compatible transformed resource.
-
#initialize(args = {}) ⇒ Exporter
constructor
A new instance of Exporter.
Constructor Details
#initialize(args = {}) ⇒ Exporter
Returns a new instance of Exporter.
7 8 9 10 11 12 |
# File 'lib/response_mate/exporter.rb', line 7 def initialize(args = {}) @format = args[:format] @manifest = args[:manifest] @environment = args[:environment] @resource = args[:resource] end |
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
5 6 7 |
# File 'lib/response_mate/exporter.rb', line 5 def environment @environment end |
#format ⇒ Object
Returns the value of attribute format.
5 6 7 |
# File 'lib/response_mate/exporter.rb', line 5 def format @format end |
#handler ⇒ Object
Returns the value of attribute handler.
5 6 7 |
# File 'lib/response_mate/exporter.rb', line 5 def handler @handler end |
#manifest ⇒ Object
Returns the value of attribute manifest.
5 6 7 |
# File 'lib/response_mate/exporter.rb', line 5 def manifest @manifest end |
#resource ⇒ Object
Returns the value of attribute resource.
5 6 7 |
# File 'lib/response_mate/exporter.rb', line 5 def resource @resource end |
Instance Method Details
#export ⇒ Object
Returns the compatible transformed resource
15 16 17 18 19 20 |
# File 'lib/response_mate/exporter.rb', line 15 def export @handler = "ResponseMate::Exporters::#{format.capitalize}".safe_constantize.new manifest, environment, resource handler.export end |