Class: Dist::Configuration::Property
- Inherits:
-
Object
- Object
- Dist::Configuration::Property
- Defined in:
- lib/dist/configuration.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #default_value ⇒ Object
- #full_name ⇒ Object
-
#initialize(section, name, type, options = {}) ⇒ Property
constructor
A new instance of Property.
- #prompt ⇒ Object
Constructor Details
#initialize(section, name, type, options = {}) ⇒ Property
Returns a new instance of Property.
97 98 99 100 101 102 |
# File 'lib/dist/configuration.rb', line 97 def initialize(section, name, type, = {}) @section = section @name = name @type = type @options = end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
94 95 96 |
# File 'lib/dist/configuration.rb', line 94 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
95 96 97 |
# File 'lib/dist/configuration.rb', line 95 def type @type end |
Instance Method Details
#default_value ⇒ Object
108 109 110 |
# File 'lib/dist/configuration.rb', line 108 def default_value @options[:default] end |
#full_name ⇒ Object
104 105 106 |
# File 'lib/dist/configuration.rb', line 104 def full_name "#{@section.name}/#{name}" end |
#prompt ⇒ Object
112 113 114 |
# File 'lib/dist/configuration.rb', line 112 def prompt @options[:prompt] || "#{@section.name} #{name}" end |