Sha256: c5ada49561e72a93648de50da8db898ea21fc3b19b76f52d340ecf5a29103334

Contents?: true

Size: 671 Bytes

Versions: 7

Compression:

Stored size: 671 Bytes

Contents

module PuppetStrings::Yard::Parsers::JSON
  # Represents the Puppet Task statement.
  class TaskStatement
    attr_reader :line, :comments, :comments_range, :json, :file, :source, :docstring

    def initialize(json, source, file)
      @file = file
      @source = source
      @json = json
      @line = 0
      @comments_range = nil
      @docstring = YARD::Docstring.new(@json['description'])
    end

    def parameters
      json['parameters'] || {}
    end

    def comments_hash_flag
      false
    end

    def show
      ""
    end

    def comments
      docstring.all
    end

    def name
      File.basename(@file).gsub('.json','') || ""
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
puppet-strings-2.5.0 lib/puppet-strings/yard/parsers/json/task_statement.rb
puppet-strings-2.4.0 lib/puppet-strings/yard/parsers/json/task_statement.rb
puppet-strings-2.3.1 lib/puppet-strings/yard/parsers/json/task_statement.rb
puppet-strings-2.3.0 lib/puppet-strings/yard/parsers/json/task_statement.rb
puppet-strings-2.2.0 lib/puppet-strings/yard/parsers/json/task_statement.rb
puppet-strings-2.1.0 lib/puppet-strings/yard/parsers/json/task_statement.rb
puppet-strings-2.0.0 lib/puppet-strings/yard/parsers/json/task_statement.rb