Class: JsDuck::Tag::Preventable

Inherits:
MetaTag
  • Object
show all
Defined in:
lib/jsduck/tag/preventable.rb

Overview

Implementation of @preventable tag

Instance Attribute Summary

Attributes inherited from MetaTag

#assets, #boolean, #context, #formatter, #key, #multiline, #name, #position, #signature

Instance Method Summary collapse

Methods inherited from MetaTag

descendants, #format

Constructor Details

#initializePreventable

Returns a new instance of Preventable.



6
7
8
9
10
# File 'lib/jsduck/tag/preventable.rb', line 6

def initialize
  @name = "preventable"
  @key = :preventable
  @signature = {:long => "preventable", :short => "PREV"}
end

Instance Method Details

#to_html(v) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/jsduck/tag/preventable.rb', line 18

def to_html(v)
  <<-EOHTML
    <div class='signature-box preventable'>
    <p>This action following this event is <b>preventable</b>.
    When any of the listeners returns false, the action is cancelled.</p>
    </div>
  EOHTML
end

#to_value(contents) ⇒ Object

don’t document it.



14
15
16
# File 'lib/jsduck/tag/preventable.rb', line 14

def to_value(contents)
  true
end