Class: Cadenya::Types::ToolSetAdapter_BareVariant

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, bare: nil) ⇒ ToolSetAdapter_BareVariant

Returns a new instance of ToolSetAdapter_BareVariant.



8016
8017
8018
8019
# File 'lib/cadenya/types.rb', line 8016

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

Instance Attribute Details

#bareObject (readonly)

Returns the value of attribute bare.



8014
8015
8016
# File 'lib/cadenya/types.rb', line 8014

def bare
  @bare
end

#typeObject (readonly)

Returns the value of attribute type.



8014
8015
8016
# File 'lib/cadenya/types.rb', line 8014

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8021
8022
8023
8024
8025
8026
# File 'lib/cadenya/types.rb', line 8021

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

Instance Method Details

#to_hObject



8028
8029
8030
8031
8032
8033
# File 'lib/cadenya/types.rb', line 8028

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