class Begin::ValueTag

Represents a tag with a single value. Value tags can have a default value assigned in the config. If the user chooses not to enter a value, the default value is substituted instead.

Attributes

default[R]

Public Class Methods

from_config(key, value) click to toggle source
# File lib/begin/config.rb, line 63
def self.from_config(key, value)
  array = value.include?('array') ? value['array'] : false
  label = value.include?('label') ? value['label'] : key
  default = value.include?('default') ? value['default'] : ''
  ValueTag.new key, label, array, default
end
new(key, label, array, default) click to toggle source
Calls superclass method Begin::Tag::new
# File lib/begin/config.rb, line 58
def initialize(key, label, array, default)
  super key, label, array
  @default = default
end