Class: Simp::Cli::Config::Item::PuppetDBPort
- Inherits:
-
Simp::Cli::Config::Item
- Object
- Simp::Cli::Config::Item
- Simp::Cli::Config::Item::PuppetDBPort
- Defined in:
- lib/simp/cli/config/item/puppetdb_port.rb
Instance Attribute Summary
Attributes inherited from Simp::Cli::Config::Item
#allow_user_apply, #config_items, #description, #die_on_apply_fail, #fact, #fail_on_missing_answer, #key, #next_items_tree, #silent, #skip_apply, #skip_query, #skip_yaml, #value
Instance Method Summary collapse
-
#initialize ⇒ PuppetDBPort
constructor
A new instance of PuppetDBPort.
- #recommended_value ⇒ Object
- #validate(string) ⇒ Object
Methods inherited from Simp::Cli::Config::Item
#apply, #default_value, #highline_question_type, #next_items, #not_valid_message, #os_value, #print_banner, #print_summary, #puppet_value, #query, #query_ask, #query_extras, #query_status, #safe_apply, #say_blue, #say_green, #say_red, #say_yellow, #to_yaml_s
Constructor Details
#initialize ⇒ PuppetDBPort
Returns a new instance of PuppetDBPort.
9 10 11 12 13 14 |
# File 'lib/simp/cli/config/item/puppetdb_port.rb', line 9 def initialize super @key = 'puppetdb::master::config::puppetdb_port' @description = %Q{The PuppetDB server port number} @value = recommended_value end |
Instance Method Details
#recommended_value ⇒ Object
16 17 18 |
# File 'lib/simp/cli/config/item/puppetdb_port.rb', line 16 def recommended_value '8139' end |
#validate(string) ⇒ Object
20 21 22 23 |
# File 'lib/simp/cli/config/item/puppetdb_port.rb', line 20 def validate string ( string =~ /^\d+$/ ? true : false ) && ( string.to_i > 1 && string.to_i < 65536 ) end |