Class: MyConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/lib/myconfig.rb

Overview

~/config.ymlに配置された設定ファイルを読んで返す

Constant Summary collapse

@@file =
nil
@@data =
nil

Class Method Summary collapse

Class Method Details

.getObject

設定オブジェクトを返す



16
17
18
19
# File 'lib/lib/myconfig.rb', line 16

def self.get
  self.read if @@data.nil?
  return @@data
end

.hogeObject



11
12
13
# File 'lib/lib/myconfig.rb', line 11

def self.hoge
  return @@file
end

.set(filename) ⇒ Object



7
8
9
# File 'lib/lib/myconfig.rb', line 7

def self.set(filename)
  @@file = filename
end