Class: UserSetting::Setting
- Inherits:
-
Object
- Object
- UserSetting::Setting
- Defined in:
- lib/cocoapods-devtool/setting/user_setting_tool.rb
Instance Attribute Summary collapse
-
#change_bundle_pre ⇒ Object
Returns the value of attribute change_bundle_pre.
-
#dev_team ⇒ Object
Returns the value of attribute dev_team.
-
#modes ⇒ Object
Returns the value of attribute modes.
Instance Method Summary collapse
-
#initialize ⇒ Setting
constructor
A new instance of Setting.
- #readSettingData ⇒ Object
- #save ⇒ Object
- #set(key, value) ⇒ Object
Constructor Details
#initialize ⇒ Setting
Returns a new instance of Setting.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/cocoapods-devtool/setting/user_setting_tool.rb', line 6 def initialize @jsonPath = '../../../setting/user_setting.json' path = File.(@jsonPath, __FILE__) data = File.open(path) do |f| JSON.load(f) end @settingData = data @change_bundle_pre = @settingData["change_bundle_pre"] @dev_team = @settingData["dev_team"] @modes = @settingData["modes"] end |
Instance Attribute Details
#change_bundle_pre ⇒ Object
Returns the value of attribute change_bundle_pre.
4 5 6 |
# File 'lib/cocoapods-devtool/setting/user_setting_tool.rb', line 4 def change_bundle_pre @change_bundle_pre end |
#dev_team ⇒ Object
Returns the value of attribute dev_team.
4 5 6 |
# File 'lib/cocoapods-devtool/setting/user_setting_tool.rb', line 4 def dev_team @dev_team end |
#modes ⇒ Object
Returns the value of attribute modes.
4 5 6 |
# File 'lib/cocoapods-devtool/setting/user_setting_tool.rb', line 4 def modes @modes end |
Instance Method Details
#readSettingData ⇒ Object
18 19 20 |
# File 'lib/cocoapods-devtool/setting/user_setting_tool.rb', line 18 def readSettingData() @settingData end |
#save ⇒ Object
26 27 28 29 30 31 |
# File 'lib/cocoapods-devtool/setting/user_setting_tool.rb', line 26 def save() return if @settingData.nil? path = File.(@jsonPath, __FILE__) json = JSON.generate(@settingData) File.write(path,json) end |
#set(key, value) ⇒ Object
22 23 24 |
# File 'lib/cocoapods-devtool/setting/user_setting_tool.rb', line 22 def set(key,value) @settingData[key] = value end |