Class: Autodoc::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/autodoc/configuration.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.property(name, &default) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/autodoc/configuration.rb', line 5

def property(name, &default)
  define_method(name) do
    if instance_variable_defined?("@#{name}")
      instance_variable_get("@#{name}")
    else
      instance_variable_set("@#{name}", instance_exec(&default))
    end
  end

  attr_writer name
end

Instance Method Details

#pathnameObject



53
54
55
# File 'lib/autodoc/configuration.rb', line 53

def pathname
  Pathname.new(Shellwords.shellescape(path))
end