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.



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

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.



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

def context
  @context
end

Instance Method Details

#<=>(other) ⇒ Object



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

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

#arefObject



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

def aref
  @seq
end

#as_href(from_path) ⇒ Object



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

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

#descriptionObject



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

def description
  markup(@context.comment)
end

#document_selfObject



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

def document_self
  @context.document_self
end

#find_symbol(symbol, method = nil) ⇒ Object



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

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

#index_nameObject



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

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

#nameObject



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

def name
  @context.name
end

#paramsObject



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

def params
  @context.params
end

#parent_nameObject



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

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

#pathObject



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

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

#sectionObject



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

def section
  @context.section
end