Class: Cadenya::Types::ToolSpec_Config_Http

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, http: nil) ⇒ ToolSpec_Config_Http

Returns a new instance of ToolSpec_Config_Http.



8458
8459
8460
8461
# File 'lib/cadenya/types.rb', line 8458

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

Instance Attribute Details

#httpObject (readonly)

Returns the value of attribute http.



8456
8457
8458
# File 'lib/cadenya/types.rb', line 8456

def http
  @http
end

#typeObject (readonly)

Returns the value of attribute type.



8456
8457
8458
# File 'lib/cadenya/types.rb', line 8456

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8463
8464
8465
8466
8467
8468
# File 'lib/cadenya/types.rb', line 8463

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

Instance Method Details

#to_hObject



8470
8471
8472
8473
8474
8475
# File 'lib/cadenya/types.rb', line 8470

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