Skip to content

Commit 4e199dd

Browse files
committed
Add @option tag the same as @parameter.
1 parent 7095ccb commit 4e199dd

4 files changed

Lines changed: 23 additions & 1 deletion

File tree

lib/decode.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55

66
require_relative "decode/version"
77
require_relative "decode/index"
8+
9+
# @namespace
10+
module Decode
11+
end

lib/decode/comment/option.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2020, by Samuel Williams.
5+
6+
require_relative 'parameter'
7+
8+
module Decode
9+
module Comment
10+
# Describes a method option (keyword argument).
11+
#
12+
# - `@option :cached [Boolean] Whether to cache the value.`
13+
#
14+
class Option < Parameter
15+
end
16+
end
17+
end

lib/decode/documentation.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
require_relative 'comment/tags'
99
require_relative 'comment/attribute'
1010
require_relative 'comment/parameter'
11+
require_relative 'comment/option'
1112
require_relative 'comment/pragma'
1213
require_relative 'comment/raises'
1314
require_relative 'comment/returns'

lib/decode/language/generic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
module Decode
1010
module Language
11-
# The Ruby language.
1211
class Generic
1312
EXTENSIONS = []
1413

1514
TAGS = Comment::Tags.build do |tags|
1615
tags['attribute'] = Comment::Attribute
1716
tags['parameter'] = Comment::Parameter
17+
tags['option'] = Comment::Option
1818
tags['yields'] = Comment::Yields
1919
tags['returns'] = Comment::Returns
2020
tags['raises'] = Comment::Raises

0 commit comments

Comments
 (0)