Class: Asciidoctor::ConfluencePublisher::Asciidoc

Inherits:
Object
  • Object
show all
Defined in:
lib/asciidoctor/confluence_publisher/asciidoc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Asciidoc

Returns a new instance of Asciidoc.



6
7
8
9
# File 'lib/asciidoctor/confluence_publisher/asciidoc.rb', line 6

def initialize(path)
  @path = path
  @children = []
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



4
5
6
# File 'lib/asciidoctor/confluence_publisher/asciidoc.rb', line 4

def children
  @children
end

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/asciidoctor/confluence_publisher/asciidoc.rb', line 4

def path
  @path
end

Instance Method Details

#add_child(child) ⇒ Object



19
20
21
22
# File 'lib/asciidoctor/confluence_publisher/asciidoc.rb', line 19

def add_child(child)
  return if child.nil?
  @children << child
end

#has_any_leaves?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/asciidoctor/confluence_publisher/asciidoc.rb', line 28

def has_any_leaves?
  traverse_file_tree(self)
end

#is_directory?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/asciidoctor/confluence_publisher/asciidoc.rb', line 15

def is_directory?
  File.directory?(path)
end

#is_leaves?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/asciidoctor/confluence_publisher/asciidoc.rb', line 11

def is_leaves?
  !is_directory?
end

#to_sObject



24
25
26
# File 'lib/asciidoctor/confluence_publisher/asciidoc.rb', line 24

def to_s
  inspect
end