Class: Dcc::Transform::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/dcc/transform/result.rb

Overview

Output of an XSLT transform.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload:, engine:) ⇒ Result

Returns a new instance of Result.



9
10
11
12
# File 'lib/dcc/transform/result.rb', line 9

def initialize(payload:, engine:)
  @payload = payload
  @engine = engine
end

Instance Attribute Details

#engineObject (readonly)

Returns the value of attribute engine.



7
8
9
# File 'lib/dcc/transform/result.rb', line 7

def engine
  @engine
end

#payloadObject (readonly)

Returns the value of attribute payload.



7
8
9
# File 'lib/dcc/transform/result.rb', line 7

def payload
  @payload
end

Instance Method Details

#to_json(*_args) ⇒ Object



18
19
20
21
# File 'lib/dcc/transform/result.rb', line 18

def to_json(*_args)
  require "json"
  ::JSON.pretty_generate(engine: @engine, payload: @payload)
end

#to_sObject



14
15
16
# File 'lib/dcc/transform/result.rb', line 14

def to_s
  @payload
end