Class: Cadenya::Types::ToolSpec_Config_Bare

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) ⇒ ToolSpec_Config_Bare

Returns a new instance of ToolSpec_Config_Bare.



8527
8528
8529
8530
# File 'lib/cadenya/types.rb', line 8527

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

Instance Attribute Details

#bareObject (readonly)

Returns the value of attribute bare.



8525
8526
8527
# File 'lib/cadenya/types.rb', line 8525

def bare
  @bare
end

#typeObject (readonly)

Returns the value of attribute type.



8525
8526
8527
# File 'lib/cadenya/types.rb', line 8525

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8532
8533
8534
8535
8536
8537
# File 'lib/cadenya/types.rb', line 8532

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

Instance Method Details

#to_hObject



8539
8540
8541
8542
8543
8544
# File 'lib/cadenya/types.rb', line 8539

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