Class: PuppetStrings::Yard::Parsers::JSON::TaskStatement
- Inherits:
-
Object
- Object
- PuppetStrings::Yard::Parsers::JSON::TaskStatement
- Defined in:
- lib/puppet-strings/yard/parsers/json/task_statement.rb
Overview
Represents the Puppet Task statement.
Instance Attribute Summary collapse
-
#comments_range ⇒ Object
readonly
Returns the value of attribute comments_range.
-
#docstring ⇒ Object
readonly
Returns the value of attribute docstring.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#json ⇒ Object
readonly
Returns the value of attribute json.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #comments ⇒ Object
- #comments_hash_flag ⇒ Object
-
#initialize(json, source, file) ⇒ TaskStatement
constructor
A new instance of TaskStatement.
- #name ⇒ Object
- #parameters ⇒ Object
- #show ⇒ Object
Constructor Details
#initialize(json, source, file) ⇒ TaskStatement
Returns a new instance of TaskStatement.
8 9 10 11 12 13 14 15 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 8 def initialize(json, source, file) @file = file @source = source @json = json @line = 0 @comments_range = nil @docstring = YARD::Docstring.new(@json['description']) end |
Instance Attribute Details
#comments_range ⇒ Object (readonly)
Returns the value of attribute comments_range.
6 7 8 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 6 def comments_range @comments_range end |
#docstring ⇒ Object (readonly)
Returns the value of attribute docstring.
6 7 8 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 6 def docstring @docstring end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
6 7 8 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 6 def file @file end |
#json ⇒ Object (readonly)
Returns the value of attribute json.
6 7 8 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 6 def json @json end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
6 7 8 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 6 def line @line end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
6 7 8 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 6 def source @source end |
Instance Method Details
#comments ⇒ Object
29 30 31 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 29 def comments docstring.all end |
#comments_hash_flag ⇒ Object
21 22 23 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 21 def comments_hash_flag false end |
#name ⇒ Object
33 34 35 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 33 def name File.basename(@file).gsub('.json', '') || '' end |
#parameters ⇒ Object
17 18 19 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 17 def parameters json['parameters'] || {} end |
#show ⇒ Object
25 26 27 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 25 def show '' end |