Class: Lookbook::YardTag

Inherits:
YARD::Tags::Tag
  • Object
show all
Defined in:
lib/lookbook/tags/yard_tag.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ YardTag

Returns a new instance of YardTag.



3
4
5
6
7
8
9
10
# File 'lib/lookbook/tags/yard_tag.rb', line 3

def initialize(*args)
  if args.size < 2
    tag_name = self.class.name.demodulize.underscore.chomp("_tag")
    super(tag_name, args.first, nil, @name)
  else
    super(*args)
  end
end

Class Method Details

.supports_options(value = true) ⇒ Object



29
30
31
# File 'lib/lookbook/tags/yard_tag.rb', line 29

def self.supports_options(value = true)
  @supports_options = !!value
end

.supports_options?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/lookbook/tags/yard_tag.rb', line 33

def self.supports_options?
  @supports_options.nil? ? false : @supports_options
end

Instance Method Details

#optionsObject



16
17
18
# File 'lib/lookbook/tags/yard_tag.rb', line 16

def options
  tag_parts[:options]
end

#textObject Also known as: value



12
13
14
# File 'lib/lookbook/tags/yard_tag.rb', line 12

def text
  tag_parts[:text]
end

#to_sObject



20
21
22
# File 'lib/lookbook/tags/yard_tag.rb', line 20

def to_s
  value.to_s
end