Class: Cadenya::Types::ObjectiveEventData_Notice

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, notice: nil) ⇒ ObjectiveEventData_Notice

Returns a new instance of ObjectiveEventData_Notice.



8895
8896
8897
8898
# File 'lib/cadenya/types.rb', line 8895

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

Instance Attribute Details

#noticeObject (readonly)

Returns the value of attribute notice.



8893
8894
8895
# File 'lib/cadenya/types.rb', line 8893

def notice
  @notice
end

#typeObject (readonly)

Returns the value of attribute type.



8893
8894
8895
# File 'lib/cadenya/types.rb', line 8893

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8900
8901
8902
8903
8904
8905
# File 'lib/cadenya/types.rb', line 8900

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

Instance Method Details

#to_hObject



8907
8908
8909
8910
8911
8912
# File 'lib/cadenya/types.rb', line 8907

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