Class: Generators::HTMLPuppetResource

Inherits:
Object
  • Object
show all
Includes:
MarkUp
Defined in:
lib/puppet/util/rdoc/generators/puppet_generator.rb

Constant Summary collapse

@@seq =
"R000000"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MarkUp

#new_markup

Constructor Details

#initialize(context, html_class, options) ⇒ HTMLPuppetResource

Returns a new instance of HTMLPuppetResource.



830
831
832
833
834
835
836
837
838
839
840
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 830

def initialize(context, html_class, options)
  @context    = context
  @html_class = html_class
  @options    = options
  @@seq       = @@seq.succ
  @seq        = @@seq

  context.viewer = self

  AllReferences.add(name, self)
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



826
827
828
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 826

def context
  @context
end

Instance Method Details

#<=>(other) ⇒ Object



890
891
892
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 890

def <=>(other)
  @context <=> other.context
end

#arefObject



874
875
876
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 874

def aref
  @seq
end

#as_href(from_path) ⇒ Object



842
843
844
845
846
847
848
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 842

def as_href(from_path)
  if @options.all_one_file
    "##{path}"
  else
    HTMLGenerator.gen_url(from_path, path)
  end
end

#descriptionObject



886
887
888
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 886

def description
  markup(@context.comment)
end

#document_selfObject



894
895
896
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 894

def document_self
  @context.document_self
end

#find_symbol(symbol, method = nil) ⇒ Object



898
899
900
901
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 898

def find_symbol(symbol, method=nil)
  res = @context.parent.find_symbol(symbol, method)
  res &&= res.viewer
end

#index_nameObject



858
859
860
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 858

def index_name
  "#{@context.name}"
end

#nameObject



850
851
852
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 850

def name
  @context.name
end

#paramsObject



862
863
864
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 862

def params
  @context.params
end

#parent_nameObject



866
867
868
869
870
871
872
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 866

def parent_name
  if @context.parent.parent
    @context.parent.parent.full_name
  else
    nil
  end
end

#pathObject



878
879
880
881
882
883
884
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 878

def path
  if @options.all_one_file
    aref
  else
    @html_class.path + "##{aref}"
  end
end

#sectionObject



854
855
856
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 854

def section
  @context.section
end