Class: Cadenya::Types::ToolSetAdapter_HttpVariant

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

Returns a new instance of ToolSetAdapter_HttpVariant.



7970
7971
7972
7973
# File 'lib/cadenya/types.rb', line 7970

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

Instance Attribute Details

#httpObject (readonly)

Returns the value of attribute http.



7968
7969
7970
# File 'lib/cadenya/types.rb', line 7968

def http
  @http
end

#typeObject (readonly)

Returns the value of attribute type.



7968
7969
7970
# File 'lib/cadenya/types.rb', line 7968

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



7975
7976
7977
7978
7979
7980
# File 'lib/cadenya/types.rb', line 7975

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

Instance Method Details

#to_hObject



7982
7983
7984
7985
7986
7987
# File 'lib/cadenya/types.rb', line 7982

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