Class: Module

### Home Classes Methods

### In Files

- lib/inline.rb

### Parent

Object

### Methods

- #inline

### Files

- History.txt
- Manifest.txt
- README.txt

### Class/Module Index

Quicksearch

- Inline
- Inline::C
- CompilationError
- Dir
- File
- Module

No matching classes.

# Module

### Public Instance Methods

inline(lang = :C, options={}) click to toggle source

Extends the Module class to have an inline method. The default language/builder used is C, but can be specified with the `lang` parameter.

    # File lib/inline.rb, line 828
    def inline(lang = :C, options={})
      Inline.register self

      case options
      when TrueClass, FalseClass then
        warn "WAR\NING: 2nd argument to inline is now a hash, changing to {:testing=>#{options}}" unless options
        options = { :testing => options  }
      when Hash
        options[:testing] ||= false
      else
        raise ArgumentError, "BLAH"
      end

      builder_class = begin
                        Inline.const_get(lang)
                      rescue NameError
                        require "inline/#{lang}"
                        Inline.const_get(lang)
                      end

      builder = builder_class.new self

      yield builder

      unless options[:testing] then
        unless builder.load_cache then
          builder.build
          builder.load
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.