Class: Konfig::SchemaAttributeDSL

Inherits:
Object
  • Object
show all
Defined in:
lib/konfig/schema_attribute_dsl.rb

Instance Method Summary collapse

Constructor Details

#initialize(attribute) ⇒ SchemaAttributeDSL

Returns a new instance of SchemaAttributeDSL.



8
9
10
# File 'lib/konfig/schema_attribute_dsl.rb', line 8

def initialize(attribute)
  @attribute = attribute
end

Instance Method Details

#arrayObject



25
26
27
# File 'lib/konfig/schema_attribute_dsl.rb', line 25

def array
  @attribute.array = true
end

#default(value) ⇒ Object



16
17
18
# File 'lib/konfig/schema_attribute_dsl.rb', line 16

def default(value)
  @attribute.default = value
end

#description(value) ⇒ Object Also known as: desc



20
21
22
# File 'lib/konfig/schema_attribute_dsl.rb', line 20

def description(value)
  @attribute.description = value
end

#transform(value = nil, &block) ⇒ Object



29
30
31
# File 'lib/konfig/schema_attribute_dsl.rb', line 29

def transform(value = nil, &block)
  @attribute.transformer = block || value
end

#type(value) ⇒ Object



12
13
14
# File 'lib/konfig/schema_attribute_dsl.rb', line 12

def type(value)
  @attribute.type = value
end