Module: MountDoc::Config

Defined in:
lib/mount_doc/config.rb

Constant Summary collapse

Components =
[
  :files,
  :urls,
  :controllers
]
DefaultSettings =
{
  auto_mount: false,
  auto_mount_path: '/doc',
  visible_private_methods: false,
  visible_protected_methods: false,
  visible_components: Components,
  doc_file_path: 'doc',
  markup: :rdoc
}

Class Method Summary collapse

Class Method Details

.auto_mount=(bool) ⇒ Object



5
6
7
# File 'lib/mount_doc/config.rb', line 5

def auto_mount=(bool)
  @@auto_mount = !!bool
end

.auto_mount?Boolean

Returns:

  • (Boolean)


9
# File 'lib/mount_doc/config.rb', line 9

def auto_mount?; @@auto_mount; end

.auto_mount_path=(path) ⇒ Object



12
13
14
# File 'lib/mount_doc/config.rb', line 12

def auto_mount_path=(path)
  @@auto_mount_path = path.to_s
end

.defaults!Object



66
67
68
69
70
# File 'lib/mount_doc/config.rb', line 66

def defaults!
  DefaultSettings.each_pair do | name, val |
    self.send("#{name}=", val)
  end
end

.doc_file_path=(path) ⇒ Object



46
47
48
# File 'lib/mount_doc/config.rb', line 46

def doc_file_path=(path)
  @@doc_file_path = path.to_s
end

.markup=(path) ⇒ Object



52
53
54
# File 'lib/mount_doc/config.rb', line 52

def markup=(path)
  @@markup = path.to_s
end

.visible_components=(components) ⇒ Object



39
40
41
42
# File 'lib/mount_doc/config.rb', line 39

def visible_components=(components)
  components.select!{|component| Components.include?(component) }
  @@visible_components = components
end

.visible_private_methods=(visible) ⇒ Object



18
19
20
# File 'lib/mount_doc/config.rb', line 18

def visible_private_methods=(visible)
  @@visible_private_methods = !!visible
end

.visible_private_methods?Boolean

Returns:

  • (Boolean)


22
# File 'lib/mount_doc/config.rb', line 22

def visible_private_methods?; @@visible_private_methods; end

.visible_protected_methods=(visible) ⇒ Object



26
27
28
# File 'lib/mount_doc/config.rb', line 26

def visible_protected_methods=(visible)
  @@visible_protected_methods = !!visible
end

.visible_protected_methods?Boolean

Returns:

  • (Boolean)


30
# File 'lib/mount_doc/config.rb', line 30

def visible_protected_methods?; @@visible_protected_methods; end