{
"schema": "codoc/v1",
"metadata": {
"name": "my_app",
"version": "1.0.0",
"language": "ruby",
"generatedAt": "2025-01-15T10:00:00Z",
"sourceRoot": "lib",
"files": ["lib/my_app.rb", "lib/my_app/base.rb", "lib/my_app/configurable.rb"],
"externalLinks": {
"ruby": {
"baseUrl": "https://ruby-doc.org/core-3.3.0",
"urlTemplate": "{baseUrl}/{qualifiedName}.html",
"transform": {
"nameSeparator": "/",
"methodPrefix": "#method-i-",
"classMethodPrefix": "#method-c-"
},
"symbols": {
"String": "https://ruby-doc.org/core-3.3.0/String.html",
"Hash": "https://ruby-doc.org/core-3.3.0/Hash.html",
"Array": "https://ruby-doc.org/core-3.3.0/Array.html",
"Integer": "https://ruby-doc.org/core-3.3.0/Integer.html",
"Symbol": "https://ruby-doc.org/core-3.3.0/Symbol.html",
"Time": "https://ruby-doc.org/core-3.3.0/Time.html",
"Boolean": "https://ruby-doc.org/core-3.3.0/TrueClass.html"
}
},
"rails": {
"baseUrl": "https://api.rubyonrails.org/classes",
"urlTemplate": "{baseUrl}/{qualifiedName}.html",
"transform": {
"nameSeparator": "/"
},
"symbols": {
"ActiveSupport::Concern": "https://api.rubyonrails.org/classes/ActiveSupport/Concern.html",
"ActiveRecord::Base": "https://api.rubyonrails.org/classes/ActiveRecord/Base.html"
}
}
}
},
"entities": [
{
"id": "MyApp",
"name": "MyApp",
"kind": "module",
"location": { "file": "lib/my_app.rb", "line": 1 },
"visibility": "public",
"docs": {
"summary": "Main application module"
},
"constants": [
{
"id": "MyApp::VERSION",
"name": "VERSION",
"kind": "constant",
"type": { "name": "String", "kind": "simple" },
"value": "\"1.0.0\"",
"visibility": "public",
"docs": {
"summary": "Current version of the library"
}
},
{
"id": "MyApp::DEFAULT_TIMEOUT",
"name": "DEFAULT_TIMEOUT",
"kind": "constant",
"type": { "name": "Integer", "kind": "simple" },
"value": "30",
"visibility": "public",
"docs": {
"summary": "Default timeout in seconds"
}
}
],
"modules": [
{
"id": "MyApp::Helpers",
"name": "Helpers",
"kind": "module",
"location": { "file": "lib/my_app/helpers.rb", "line": 5 },
"visibility": "public",
"docs": {
"summary": "Helper methods for common operations"
},
"instanceMethods": [
{
"id": "MyApp::Helpers#format_date",
"name": "format_date",
"kind": "method",
"visibility": "public",
"docs": {
"summary": "Formats a date according to the specified format",
"examples": [
{
"code": "format_date(Time.current, format: :short)",
"language": "ruby"
}
]
},
"params": [
{
"name": "date",
"type": { "name": "Time", "kind": "simple" },
"description": "The date to format"
},
{
"name": "options",
"type": { "name": "Hash", "kind": "simple" },
"optional": true,
"default": "{}",
"options": [
{
"name": "format",
"type": { "name": "Symbol", "kind": "simple" },
"description": "Date format to use (:short, :long, :iso)"
},
{
"name": "timezone",
"type": { "name": "String", "kind": "simple" },
"description": "Timezone for display"
}
]
}
],
"returns": { "name": "String", "kind": "simple" },
"returnsDescription": "Formatted date string"
}
]
}
],
"classes": [
{
"id": "MyApp::Base",
"name": "Base",
"kind": "class",
"location": { "file": "lib/my_app/base.rb", "line": 8 },
"visibility": "public",
"docs": {
"summary": "Base class for application components",
"description": "Provides common functionality including configuration, logging, and lifecycle hooks."
},
"constructor": {
"id": "MyApp::Base#initialize",
"name": "initialize",
"kind": "constructor",
"params": [
{
"name": "options",
"type": { "name": "Hash", "kind": "simple" },
"optional": true,
"default": "{}",
"options": [
{
"name": "name",
"type": { "name": "String", "kind": "simple" },
"description": "Component name for identification"
},
{
"name": "logger",
"type": { "name": "Logger", "kind": "simple" },
"description": "Custom logger instance"
}
]
}
],
"yields": {
"description": "Yields the instance for configuration",
"params": [
{
"name": "instance",
"type": { "name": "self", "kind": "simple" },
"description": "The component instance"
}
]
}
},
"properties": [
{
"id": "MyApp::Base#name",
"name": "name",
"kind": "property",
"type": { "name": "String", "kind": "simple" },
"readonly": true,
"visibility": "public",
"docs": { "summary": "Component name" }
},
{
"id": "MyApp::Base#logger",
"name": "logger",
"kind": "property",
"type": { "name": "Logger", "kind": "simple" },
"readonly": true,
"visibility": "protected",
"docs": { "summary": "Logger instance" }
}
],
"methods": [
{
"id": "MyApp::Base#call",
"name": "call",
"kind": "method",
"visibility": "public",
"abstract": true,
"docs": {
"summary": "Executes the component",
"notes": ["Must be implemented by subclasses"]
},
"returns": { "name": "Object", "kind": "simple" },
"throws": [
{
"type": { "name": "NotImplementedError", "kind": "simple" },
"description": "if not overridden in subclass"
}
]
}
]
}
]
},
{
"id": "MyApp::Configurable",
"name": "Configurable",
"kind": "module",
"location": { "file": "lib/my_app/configurable.rb", "line": 5 },
"visibility": "public",
"isConcern": true,
"docs": {
"summary": "Adds configuration DSL to classes",
"description": "Include this module to add class-level configuration options with defaults and validation."
},
"classMethods": [
{
"id": "MyApp::Configurable.configure",
"name": "configure",
"kind": "method",
"visibility": "public",
"docs": {
"summary": "Configures the class with the given options",
"examples": [
{
"code": "class MyService\n include MyApp::Configurable\n\n configure do |config|\n config.timeout = 60\n config.retries = 3\n end\nend",
"language": "ruby"
}
]
},
"yields": {
"description": "Configuration block",
"params": [
{
"name": "config",
"type": { "name": "Configuration", "kind": "simple" },
"description": "Configuration object"
}
]
},
"returns": { "name": "void", "kind": "simple" }
},
{
"id": "MyApp::Configurable.option",
"name": "option",
"kind": "method",
"visibility": "public",
"docs": {
"summary": "Defines a configuration option"
},
"params": [
{
"name": "name",
"type": { "name": "Symbol", "kind": "simple" },
"description": "Option name"
},
{
"name": "default",
"type": { "name": "Object", "kind": "simple" },
"optional": true,
"description": "Default value"
}
],
"returns": { "name": "void", "kind": "simple" }
}
],
"instanceMethods": [
{
"id": "MyApp::Configurable#config",
"name": "config",
"kind": "method",
"visibility": "public",
"docs": {
"summary": "Returns the current configuration"
},
"returns": {
"name": "Configuration",
"kind": "simple",
"ref": "MyApp::Configuration"
}
}
]
},
{
"id": "MyApp::Services::Calculator",
"name": "Calculator",
"kind": "class",
"location": { "file": "lib/my_app/services/calculator.rb", "line": 3 },
"visibility": "public",
"docs": {
"summary": "Performs mathematical calculations"
},
"extends": {
"name": "MyApp::Base",
"kind": "simple",
"ref": "MyApp::Base"
},
"includes": [
{ "name": "MyApp::Configurable", "kind": "simple", "ref": "MyApp::Configurable" }
],
"methods": [
{
"id": "MyApp::Services::Calculator#add",
"name": "add",
"kind": "method",
"visibility": "public",
"docs": {
"summary": "Adds two numbers",
"examples": [
{
"code": "calculator = Calculator.new\ncalculator.add(2, 3) # => 5",
"language": "ruby"
}
]
},
"params": [
{
"name": "a",
"type": { "name": "Numeric", "kind": "simple" },
"description": "First operand"
},
{
"name": "b",
"type": { "name": "Numeric", "kind": "simple" },
"description": "Second operand"
}
],
"returns": { "name": "Numeric", "kind": "simple" },
"returnsDescription": "Sum of the two numbers"
},
{
"id": "MyApp::Services::Calculator#divide",
"name": "divide",
"kind": "method",
"visibility": "public",
"docs": {
"summary": "Divides two numbers"
},
"params": [
{
"name": "dividend",
"type": { "name": "Numeric", "kind": "simple" },
"description": "The number to be divided"
},
{
"name": "divisor",
"type": { "name": "Numeric", "kind": "simple" },
"description": "The number to divide by"
}
],
"returns": { "name": "Float", "kind": "simple" },
"throws": [
{
"type": { "name": "ZeroDivisionError", "kind": "simple" },
"description": "if divisor is zero"
}
]
}
]
},
{
"id": "Operations::User::Create",
"name": "Create",
"kind": "class",
"location": { "file": "lib/operations/user/create.rb", "line": 3 },
"visibility": "public",
"docs": {
"summary": "Creates a new user record"
},
"extends": {
"name": "MyApp::Base",
"kind": "simple",
"ref": "MyApp::Base"
},
"methods": [
{
"id": "Operations::User::Create#call",
"name": "call",
"kind": "method",
"visibility": "public",
"docs": {
"summary": "Executes the user creation"
},
"params": [
{
"name": "attributes",
"type": { "name": "Hash", "kind": "simple" },
"description": "User attributes",
"options": [
{
"name": "name",
"type": { "name": "String", "kind": "simple" },
"required": true,
"description": "User's full name"
},
{
"name": "email",
"type": { "name": "String", "kind": "simple" },
"required": true,
"description": "User's email address"
},
{
"name": "role",
"type": { "name": "Symbol", "kind": "simple" },
"default": ":member",
"description": "User role"
}
]
}
],
"returns": { "name": "User", "kind": "simple" },
"throws": [
{
"type": { "name": "ArgumentError", "kind": "simple" },
"description": "if required attributes are missing"
},
{
"type": { "name": "ValidationError", "kind": "simple" },
"description": "if attributes are invalid"
}
]
}
]
}
],
"symbols": [
{ "id": "MyApp", "name": "MyApp", "qualifiedName": "MyApp", "kind": "module", "file": "lib/my_app.rb", "line": 1 },
{ "id": "MyApp::VERSION", "name": "VERSION", "qualifiedName": "MyApp::VERSION", "kind": "constant", "parent": "MyApp", "file": "lib/my_app.rb", "line": 5 },
{ "id": "MyApp::DEFAULT_TIMEOUT", "name": "DEFAULT_TIMEOUT", "qualifiedName": "MyApp::DEFAULT_TIMEOUT", "kind": "constant", "parent": "MyApp", "file": "lib/my_app.rb", "line": 6 },
{ "id": "MyApp::Helpers", "name": "Helpers", "qualifiedName": "MyApp::Helpers", "kind": "module", "parent": "MyApp", "file": "lib/my_app/helpers.rb", "line": 5 },
{ "id": "MyApp::Helpers#format_date", "name": "format_date", "qualifiedName": "MyApp::Helpers#format_date", "kind": "method", "parent": "MyApp::Helpers", "file": "lib/my_app/helpers.rb", "line": 15, "signature": "format_date(date, options = {})" },
{ "id": "MyApp::Base", "name": "Base", "qualifiedName": "MyApp::Base", "kind": "class", "parent": "MyApp", "file": "lib/my_app/base.rb", "line": 8 },
{ "id": "MyApp::Base#initialize", "name": "initialize", "qualifiedName": "MyApp::Base#initialize", "kind": "constructor", "parent": "MyApp::Base", "file": "lib/my_app/base.rb", "line": 12, "signature": "initialize(options = {}, &block)" },
{ "id": "MyApp::Base#name", "name": "name", "qualifiedName": "MyApp::Base#name", "kind": "property", "parent": "MyApp::Base", "file": "lib/my_app/base.rb", "line": 10 },
{ "id": "MyApp::Base#logger", "name": "logger", "qualifiedName": "MyApp::Base#logger", "kind": "property", "parent": "MyApp::Base", "file": "lib/my_app/base.rb", "line": 11 },
{ "id": "MyApp::Base#call", "name": "call", "qualifiedName": "MyApp::Base#call", "kind": "method", "parent": "MyApp::Base", "file": "lib/my_app/base.rb", "line": 25, "signature": "call" },
{ "id": "MyApp::Configurable", "name": "Configurable", "qualifiedName": "MyApp::Configurable", "kind": "module", "file": "lib/my_app/configurable.rb", "line": 5 },
{ "id": "MyApp::Configurable.configure", "name": "configure", "qualifiedName": "MyApp::Configurable.configure", "kind": "method", "parent": "MyApp::Configurable", "file": "lib/my_app/configurable.rb", "line": 20, "signature": "configure(&block)" },
{ "id": "MyApp::Configurable.option", "name": "option", "qualifiedName": "MyApp::Configurable.option", "kind": "method", "parent": "MyApp::Configurable", "file": "lib/my_app/configurable.rb", "line": 30, "signature": "option(name, default = nil)" },
{ "id": "MyApp::Configurable#config", "name": "config", "qualifiedName": "MyApp::Configurable#config", "kind": "method", "parent": "MyApp::Configurable", "file": "lib/my_app/configurable.rb", "line": 40, "signature": "config" },
{ "id": "MyApp::Services::Calculator", "name": "Calculator", "qualifiedName": "MyApp::Services::Calculator", "kind": "class", "file": "lib/my_app/services/calculator.rb", "line": 3 },
{ "id": "MyApp::Services::Calculator#add", "name": "add", "qualifiedName": "MyApp::Services::Calculator#add", "kind": "method", "parent": "MyApp::Services::Calculator", "file": "lib/my_app/services/calculator.rb", "line": 10, "signature": "add(a, b)" },
{ "id": "MyApp::Services::Calculator#divide", "name": "divide", "qualifiedName": "MyApp::Services::Calculator#divide", "kind": "method", "parent": "MyApp::Services::Calculator", "file": "lib/my_app/services/calculator.rb", "line": 20, "signature": "divide(dividend, divisor)" },
{ "id": "Operations::User::Create", "name": "Create", "qualifiedName": "Operations::User::Create", "kind": "class", "file": "lib/operations/user/create.rb", "line": 3 },
{ "id": "Operations::User::Create#call", "name": "call", "qualifiedName": "Operations::User::Create#call", "kind": "method", "parent": "Operations::User::Create", "file": "lib/operations/user/create.rb", "line": 15, "signature": "call(attributes)" }
],
"unresolvedReferences": [
{
"name": "User",
"referencedFrom": ["Operations::User::Create#call"]
},
{
"name": "MyApp::Configuration",
"referencedFrom": ["MyApp::Configurable#config"]
}
]
}