Class: Cadenya::Types::ResultAction_Transform

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content_template: nil, on_error: nil, expect_json: nil) ⇒ ResultAction_Transform

Returns a new instance of ResultAction_Transform.



4802
4803
4804
4805
4806
# File 'lib/cadenya/types.rb', line 4802

def initialize(content_template: nil, on_error: nil, expect_json: nil)
  @content_template = content_template
  @on_error = on_error
  @expect_json = expect_json
end

Instance Attribute Details

#content_templateObject (readonly)

Returns the value of attribute content_template.



4800
4801
4802
# File 'lib/cadenya/types.rb', line 4800

def content_template
  @content_template
end

#expect_jsonObject (readonly)

Returns the value of attribute expect_json.



4800
4801
4802
# File 'lib/cadenya/types.rb', line 4800

def expect_json
  @expect_json
end

#on_errorObject (readonly)

Returns the value of attribute on_error.



4800
4801
4802
# File 'lib/cadenya/types.rb', line 4800

def on_error
  @on_error
end

Class Method Details

.from_json(data) ⇒ Object



4808
4809
4810
4811
4812
4813
4814
# File 'lib/cadenya/types.rb', line 4808

def self.from_json(data)
  new(
    content_template: data["contentTemplate"],
    on_error: data["onError"],
    expect_json: data["expectJson"],
  )
end

Instance Method Details

#to_hObject



4816
4817
4818
4819
4820
4821
4822
# File 'lib/cadenya/types.rb', line 4816

def to_h
  {
    content_template: Util.plain(@content_template),
    on_error: Util.plain(@on_error),
    expect_json: Util.plain(@expect_json),
  }.reject { |_k, v| v.nil? }
end