Class: Taro::Export::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/taro/export/base.rb

Direct Known Subclasses

OpenAPIv3

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



2
3
4
# File 'lib/taro/export/base.rb', line 2

def result
  @result
end

Class Method Details

.call(declarations: Taro.declarations, title: Taro.config.api_name, version: Taro.config.api_version) ⇒ Object



4
5
6
# File 'lib/taro/export/base.rb', line 4

def self.call(declarations: Taro.declarations, title: Taro.config.api_name, version: Taro.config.api_version, **)
  new.call(declarations:, title:, version:, **)
end

Instance Method Details

#to_jsonObject



8
9
10
11
# File 'lib/taro/export/base.rb', line 8

def to_json(*)
  require 'json'
  JSON.pretty_generate(result)
end

#to_yamlObject



13
14
15
16
# File 'lib/taro/export/base.rb', line 13

def to_yaml
  require 'yaml'
  desymbolize(result).to_yaml
end