Class: Cadenya::Types::VariationAssignment_ToolSet

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, tool_set: nil, id: nil) ⇒ VariationAssignment_ToolSet

Returns a new instance of VariationAssignment_ToolSet.



7757
7758
7759
7760
7761
# File 'lib/cadenya/types.rb', line 7757

def initialize(type: nil, tool_set: nil, id: nil)
  @type = type
  @tool_set = tool_set
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



7755
7756
7757
# File 'lib/cadenya/types.rb', line 7755

def id
  @id
end

#tool_setObject (readonly)

Returns the value of attribute tool_set.



7755
7756
7757
# File 'lib/cadenya/types.rb', line 7755

def tool_set
  @tool_set
end

#typeObject (readonly)

Returns the value of attribute type.



7755
7756
7757
# File 'lib/cadenya/types.rb', line 7755

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



7763
7764
7765
7766
7767
7768
7769
# File 'lib/cadenya/types.rb', line 7763

def self.from_json(data)
  new(
    type: data["type"],
    tool_set: data["toolSet"].nil? ? nil : Types::BareMetadata.from_json(data["toolSet"]),
    id: data["id"],
  )
end

Instance Method Details

#to_hObject



7771
7772
7773
7774
7775
7776
7777
# File 'lib/cadenya/types.rb', line 7771

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