class WPDB::Config::AutoFormat

Attributes

filename[R]

Public Class Methods

new(filename) click to toggle source
# File lib/ruby-wpdb/config.rb, line 69
def initialize(filename)
  @filename = Pathname(filename)
end

Public Instance Methods

config() click to toggle source
# File lib/ruby-wpdb/config.rb, line 84
def config
  format.new(filename).config
end
format() click to toggle source
# File lib/ruby-wpdb/config.rb, line 73
def format
  case filename.extname
  when ".yml", ".yaml"
    Config::YAML
  when ".php"
    Config::WPConfig
  else
    nil
  end
end