Class: BarkestCore::SelfUpdateConfig
- Inherits:
-
Object
- Object
- BarkestCore::SelfUpdateConfig
- Includes:
- ActiveModel::Model, ActiveModel::Validations
- Defined in:
- app/models/barkest_core/self_update_config.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
- #port ⇒ Object
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
6 7 8 |
# File 'app/models/barkest_core/self_update_config.rb', line 6 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'app/models/barkest_core/self_update_config.rb', line 6 def password @password end |
#port ⇒ Object
22 23 24 25 26 |
# File 'app/models/barkest_core/self_update_config.rb', line 22 def port @port ||= 22 val = @port.to_s.to_i (1...65536).include?(val) ? val : 22 end |
#user ⇒ Object
Returns the value of attribute user.
6 7 8 |
# File 'app/models/barkest_core/self_update_config.rb', line 6 def user @user end |
Class Method Details
.load ⇒ Object
32 33 34 |
# File 'app/models/barkest_core/self_update_config.rb', line 32 def SelfUpdateConfig.load SelfUpdateConfig.new SystemConfig.get(:self_update) end |
Instance Method Details
#save ⇒ Object
28 29 30 |
# File 'app/models/barkest_core/self_update_config.rb', line 28 def save SystemConfig.set :self_update, to_h, true end |
#to_h ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'app/models/barkest_core/self_update_config.rb', line 13 def to_h { host: host.to_s, port: port, user: user.to_s, password: password.to_s, } end |