Class: Vagrant::Serial::Config
- Inherits:
-
Config::Base
- Object
- Config::Base
- Vagrant::Serial::Config
- Defined in:
- lib/vagrant-serial/config.rb
Instance Attribute Summary collapse
-
#forward_com1 ⇒ Object
Returns the value of attribute forward_com1.
-
#forward_com2 ⇒ Object
Returns the value of attribute forward_com2.
-
#sockets_path ⇒ Object
Returns the value of attribute sockets_path.
Instance Method Summary collapse
Instance Attribute Details
#forward_com1 ⇒ Object
Returns the value of attribute forward_com1.
4 5 6 |
# File 'lib/vagrant-serial/config.rb', line 4 def forward_com1 @forward_com1 end |
#forward_com2 ⇒ Object
Returns the value of attribute forward_com2.
5 6 7 |
# File 'lib/vagrant-serial/config.rb', line 5 def forward_com2 @forward_com2 end |
#sockets_path ⇒ Object
Returns the value of attribute sockets_path.
6 7 8 |
# File 'lib/vagrant-serial/config.rb', line 6 def sockets_path @sockets_path end |
Instance Method Details
#set? ⇒ Boolean
13 14 15 |
# File 'lib/vagrant-serial/config.rb', line 13 def set? forward_com1 || forward_com2 end |
#validate(env, errors) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/vagrant-serial/config.rb', line 17 def validate(env, errors) return unless set? errors.add("Host port for com1 forwarding couldn't be below 1024.") if forward_com1 && forward_com1.to_i < 1024 errors.add("Host port for com2 forwarding couldn't be below 1024.") if forward_com2 && forward_com2.to_i < 1024 end |