### Home Classes Methods

### In Files

- lib/maruku/structures.rb

### Parent

Object

### Methods

- #safe_attr_accessor
- #safe_attr_accessor1
- #safe_attr_accessor2

### Class/Module Index

Quicksearch

- MaRuKu
- MaRuKu::Errors
- MaRuKu::Exception
- MaRuKu::Helpers
- MaRuKu::In
- MaRuKu::In::Markdown
- MaRuKu::In::Markdown::BlockLevelParser
- MaRuKu::In::Markdown::BlockLevelParser::BlockContext
- MaRuKu::In::Markdown::BlockLevelParser::LineSource
- MaRuKu::In::Markdown::SpanExtension
- MaRuKu::In::Markdown::SpanLevelParser
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceDebug
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceManual
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceStrscan
- MaRuKu::In::Markdown::SpanLevelParser::HTMLHelper
- MaRuKu::In::Markdown::SpanLevelParser::SpanContext
- MaRuKu::MDDocument
- MaRuKu::MDElement
- MaRuKu::Out
- MaRuKu::Out::HTML
- MaRuKu::Out::Latex
- MaRuKu::Out::Latex::LatexEntity
- MaRuKu::Out::Markdown
- MaRuKu::Section
- MaRuKu::Strings
- MaRuKu::Tests
- Array
- Hash
- Maruku
- Module
- NilClass
- Object
- String
- Textile2Signature

No matching classes.

# Module

### Public Instance Methods

safe_attr_accessor(symbol, klass) click to toggle source
Alias for: safe_attr_accessor2
safe_attr_accessor1(symbol, klass) click to toggle source

    # File lib/maruku/structures.rb, line 24
          def safe_attr_accessor1(symbol, klass)
                  attr_reader symbol
                  code =                 def #{symbol}=(val)                          if not val.kind_of? #{klass}                                s = "\nCould not assign an object of type \#{val.class} to #{symbol}.\n\n"                                s += "Tried to assign object of class \#{val.class}:\n"+                                     "\#{val.inspect}\n"+                                     "to \#{self.class}::#{symbol} constrained to be of class #{klass}.\n"                                raise s                        end                        @#{symbol} = val                end
                  module_eval code
    end

safe_attr_accessor2(symbol, klass) click to toggle source

    # File lib/maruku/structures.rb, line 42
    def safe_attr_accessor2(symbol, klass)
            attr_accessor symbol
    end

Also aliased as: safe_attr_accessor

[Validate]

Generated with the Darkfish Rdoc Generator 2.