Class: Dotenv::Parser

### Home Classes Methods

### In Files

- lib/dotenv/parser.rb

### Parent

Object

### Methods

- ::call
- ::new
- #call

### Class/Module Index

Quicksearch

- Dotenv
- Dotenv::CLI
- Dotenv::Environment
- Dotenv::FormatError
- Dotenv::Parser
- Dotenv::Substitutions
- Dotenv::Substitutions::Command
- Dotenv::Substitutions::Variable

No matching classes.

# Dotenv::Parser

This class enables parsing of a string for key value pairs to be returned and stored in the Environment. It allows for variable substitutions and exporting of variables.

### Constants

LINE

### Attributes

substitutions[R]

### Public Class Methods

call(string) click to toggle source

    # File lib/dotenv/parser.rb, line 33
    def call(string)
      new(string).call
    end

new(string) click to toggle source

    # File lib/dotenv/parser.rb, line 38
    def initialize(string)
      @string = string
      @hash = {}
    end

### Public Instance Methods

call() click to toggle source

    # File lib/dotenv/parser.rb, line 43
    def call
      @string.split(/[\n\r]+/).each do |line|
        parse_line(line)
      end
      @hash
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.