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 ⇒ Object
readonly
Returns the value of attribute comments.
-
#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_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.
6 7 8 9 10 11 12 13 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 6 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 ⇒ Object (readonly)
Returns the value of attribute comments.
4 5 6 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 4 def comments @comments end |
#comments_range ⇒ Object (readonly)
Returns the value of attribute comments_range.
4 5 6 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 4 def comments_range @comments_range end |
#docstring ⇒ Object (readonly)
Returns the value of attribute docstring.
4 5 6 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 4 def docstring @docstring end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
4 5 6 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 4 def file @file end |
#json ⇒ Object (readonly)
Returns the value of attribute json.
4 5 6 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 4 def json @json end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
4 5 6 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 4 def line @line end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
4 5 6 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 4 def source @source end |
Instance Method Details
#comments_hash_flag ⇒ Object
19 20 21 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 19 def comments_hash_flag false end |
#name ⇒ Object
31 32 33 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 31 def name File.basename(@file).gsub('.json','') || "" end |
#parameters ⇒ Object
15 16 17 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 15 def parameters json['parameters'] || {} end |
#show ⇒ Object
23 24 25 |
# File 'lib/puppet-strings/yard/parsers/json/task_statement.rb', line 23 def show "" end |