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


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

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


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

def context
  @context
end

Instance Method Details

#<=>(other) ⇒ Object


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

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

#arefObject


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

def aref
  @seq
end

#as_href(from_path) ⇒ Object


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

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

#descriptionObject


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

def description
  markup(@context.comment)
end

#document_selfObject


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

def document_self
  @context.document_self
end

#find_symbol(symbol, method = nil) ⇒ Object


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

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

#index_nameObject


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

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

#nameObject


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

def name
  @context.name
end

#paramsObject


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

def params
  @context.params
end

#parent_nameObject


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

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

#pathObject


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

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

#sectionObject


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

def section
  @context.section
end