"Fossies" - the Fresh Open Source Software Archive

Member "asciidoctor-2.0.10/test/fixtures/tagged-class.rb" (1 Jun 2019, 370 Bytes) of package /linux/www/asciidoctor-2.0.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 class Dog
    2   #tag::init[]
    3   def initialize breed
    4     @breed = breed
    5   end
    6   #end::init[]
    7   #tag::bark[]
    8 
    9   def bark
   10     #tag::bark-beagle[]
   11     if @breed == 'beagle'
   12       'woof woof woof woof woof'
   13     #end::bark-beagle[]
   14     #tag::bark-other[]
   15     else
   16       'woof woof'
   17     #end::bark-other[]
   18     #tag::bark-all[]
   19     end
   20     #end::bark-all[]
   21   end
   22   #end::bark[]
   23 end