Class: Dist::Configuration::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/dist/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {})
  @section = section
  @name = name
  @type = type
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



94
95
96
# File 'lib/dist/configuration.rb', line 94

def name
  @name
end

#typeObject (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_valueObject



108
109
110
# File 'lib/dist/configuration.rb', line 108

def default_value
  @options[:default]
end

#full_nameObject



104
105
106
# File 'lib/dist/configuration.rb', line 104

def full_name
  "#{@section.name}/#{name}"
end

#promptObject



112
113
114
# File 'lib/dist/configuration.rb', line 112

def prompt
  @options[:prompt] || "#{@section.name} #{name}"
end