class Application

Attributes

config_filepath[R]
data[R]
lang[R]

Public Class Methods

new(language = :es) click to toggle source
# File lib/ruby-zen/application.rb, line 12
def initialize(language = :es)
  @lang = language
  @data = load_data
end

Public Instance Methods

rules() click to toggle source
# File lib/ruby-zen/application.rb, line 17
def rules
  @data[@lang] || :unknown
end

Private Instance Methods

load_data() click to toggle source
# File lib/ruby-zen/application.rb, line 23
def load_data
  basedir = File.dirname(__FILE__)
  filepath = File.join(basedir, 'files', ZEN_FILENAME)
  @config_filepath = filepath
  YAML.load(File.read(filepath))
end