Class: Cadenya::Types::AIProviderConfig_Openrouter

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, openrouter: nil) ⇒ AIProviderConfig_Openrouter

Returns a new instance of AIProviderConfig_Openrouter.



9302
9303
9304
9305
# File 'lib/cadenya/types.rb', line 9302

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

Instance Attribute Details

#openrouterObject (readonly)

Returns the value of attribute openrouter.



9300
9301
9302
# File 'lib/cadenya/types.rb', line 9300

def openrouter
  @openrouter
end

#typeObject (readonly)

Returns the value of attribute type.



9300
9301
9302
# File 'lib/cadenya/types.rb', line 9300

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



9307
9308
9309
9310
9311
9312
# File 'lib/cadenya/types.rb', line 9307

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

Instance Method Details

#to_hObject



9314
9315
9316
9317
9318
9319
# File 'lib/cadenya/types.rb', line 9314

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