Class: Cadenya::Types::Config_OpenAPI

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(path: nil, method: nil) ⇒ Config_OpenAPI

Returns a new instance of Config_OpenAPI.



1329
1330
1331
1332
# File 'lib/cadenya/types.rb', line 1329

def initialize(path: nil, method: nil)
  @path = path
  @method = method
end

Instance Attribute Details

#methodObject (readonly)

Returns the value of attribute method.



1327
1328
1329
# File 'lib/cadenya/types.rb', line 1327

def method
  @method
end

#pathObject (readonly)

Returns the value of attribute path.



1327
1328
1329
# File 'lib/cadenya/types.rb', line 1327

def path
  @path
end

Class Method Details

.from_json(data) ⇒ Object



1334
1335
1336
1337
1338
1339
# File 'lib/cadenya/types.rb', line 1334

def self.from_json(data)
  new(
    path: data["path"],
    method: data["method"],
  )
end

Instance Method Details

#to_hObject



1341
1342
1343
1344
1345
1346
# File 'lib/cadenya/types.rb', line 1341

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