Class: ConfigMapper::ConfigStruct::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/config_mapper/config_struct.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Attribute



225
226
227
# File 'lib/config_mapper/config_struct.rb', line 225

def initialize(name)
  @name = name.to_sym
end

Instance Attribute Details

#defaultObject

Returns the value of attribute default.



234
235
236
# File 'lib/config_mapper/config_struct.rb', line 234

def default
  @default
end

#descriptionObject

Returns the value of attribute description.



231
232
233
# File 'lib/config_mapper/config_struct.rb', line 231

def description
  @description
end

#factoryObject

Returns the value of attribute factory.



232
233
234
# File 'lib/config_mapper/config_struct.rb', line 232

def factory
  @factory
end

#nameObject (readonly)

Returns the value of attribute name.



229
230
231
# File 'lib/config_mapper/config_struct.rb', line 229

def name
  @name
end

#requiredObject

Returns the value of attribute required.



235
236
237
# File 'lib/config_mapper/config_struct.rb', line 235

def required
  @required
end

#validatorObject

Returns the value of attribute validator.



233
234
235
# File 'lib/config_mapper/config_struct.rb', line 233

def validator
  @validator
end

Instance Method Details

#config_docObject



246
247
248
# File 'lib/config_mapper/config_struct.rb', line 246

def config_doc
  self_doc.merge(type_doc)
end

#initial_valueObject



237
238
239
240
# File 'lib/config_mapper/config_struct.rb', line 237

def initial_value
  return factory.new if factory
  default
end