Class: Cadenya::Types::ObjectiveEventData_Error

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(type: nil, error: nil) ⇒ ObjectiveEventData_Error

Returns a new instance of ObjectiveEventData_Error.



8665
8666
8667
8668
# File 'lib/cadenya/types.rb', line 8665

def initialize(type: nil, error: nil)
  @type = type
  @error = error
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



8663
8664
8665
# File 'lib/cadenya/types.rb', line 8663

def error
  @error
end

#typeObject (readonly)

Returns the value of attribute type.



8663
8664
8665
# File 'lib/cadenya/types.rb', line 8663

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8670
8671
8672
8673
8674
8675
# File 'lib/cadenya/types.rb', line 8670

def self.from_json(data)
  new(
    type: data["type"],
    error: data["error"].nil? ? nil : Types::ObjectiveError.from_json(data["error"]),
  )
end

Instance Method Details

#to_hObject



8677
8678
8679
8680
8681
8682
# File 'lib/cadenya/types.rb', line 8677

def to_h
  {
    type: Util.plain(@type),
    error: Util.plain(@error),
  }.reject { |_k, v| v.nil? }
end