Class: ScribeDown::Section

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Section

Returns a new instance of Section.



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

def initialize(options={})
  self.options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/section.rb', line 13

def method_missing(method)
  if options.has_key?(method.to_sym)
    return self.options[method.to_sym]
  elsif options.has_key?(method.to_s)
    return self.options[method.to_s]
  else
    super.method_missing(method)
  end
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



3
4
5
# File 'lib/section.rb', line 3

def options
  @options
end

Instance Method Details

#to_sObject



9
10
11
# File 'lib/section.rb', line 9

def to_s
  "(#{path}: #{options})"
end