Class: Cadenya::Types::ObjectiveEventInfo

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(objective: nil, created_by: nil) ⇒ ObjectiveEventInfo

Returns a new instance of ObjectiveEventInfo.



3824
3825
3826
3827
# File 'lib/cadenya/types.rb', line 3824

def initialize(objective: nil, created_by: nil)
  @objective = objective
  @created_by = created_by
end

Instance Attribute Details

#created_byObject (readonly)

Returns the value of attribute created_by.



3822
3823
3824
# File 'lib/cadenya/types.rb', line 3822

def created_by
  @created_by
end

#objectiveObject (readonly)

Returns the value of attribute objective.



3822
3823
3824
# File 'lib/cadenya/types.rb', line 3822

def objective
  @objective
end

Class Method Details

.from_json(data) ⇒ Object



3829
3830
3831
3832
3833
3834
# File 'lib/cadenya/types.rb', line 3829

def self.from_json(data)
  new(
    objective: data["objective"].nil? ? nil : Types::OperationMetadata.from_json(data["objective"]),
    created_by: data["createdBy"].nil? ? nil : Types::Profile.from_json(data["createdBy"]),
  )
end

Instance Method Details

#to_hObject



3836
3837
3838
3839
3840
3841
# File 'lib/cadenya/types.rb', line 3836

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