Class: Cadenya::Types::ObjectiveEventData_Cancelled

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, cancelled: nil) ⇒ ObjectiveEventData_Cancelled

Returns a new instance of ObjectiveEventData_Cancelled.



8803
8804
8805
8806
# File 'lib/cadenya/types.rb', line 8803

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

Instance Attribute Details

#cancelledObject (readonly)

Returns the value of attribute cancelled.



8801
8802
8803
# File 'lib/cadenya/types.rb', line 8801

def cancelled
  @cancelled
end

#typeObject (readonly)

Returns the value of attribute type.



8801
8802
8803
# File 'lib/cadenya/types.rb', line 8801

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8808
8809
8810
8811
8812
8813
# File 'lib/cadenya/types.rb', line 8808

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

Instance Method Details

#to_hObject



8815
8816
8817
8818
8819
8820
# File 'lib/cadenya/types.rb', line 8815

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