Module: Paradocs::FieldDSL

Included in:
Field
Defined in:
lib/paradocs/field_dsl.rb

Overview

Field DSL host instance must implement: #meta(options Hash) #policy(key Symbol) self

Instance Method Summary collapse

Instance Method Details

#as(identifier) ⇒ Object



40
41
42
# File 'lib/paradocs/field_dsl.rb', line 40

def as(identifier)
  meta alias: identifier
end

#declaredObject



16
17
18
# File 'lib/paradocs/field_dsl.rb', line 16

def declared
  policy :declared
end

#description(text) ⇒ Object



36
37
38
# File 'lib/paradocs/field_dsl.rb', line 36

def description(text)
  meta description: text
end

#example(value) ⇒ Object



44
45
46
# File 'lib/paradocs/field_dsl.rb', line 44

def example(value)
  meta example: value
end

#length(opts) ⇒ Object



32
33
34
# File 'lib/paradocs/field_dsl.rb', line 32

def length(opts)
  policy :length, opts
end

#options(opts) ⇒ Object



20
21
22
# File 'lib/paradocs/field_dsl.rb', line 20

def options(opts)
  policy :options, opts
end

#presentObject



12
13
14
# File 'lib/paradocs/field_dsl.rb', line 12

def present
  required.policy :present
end

#requiredObject



8
9
10
# File 'lib/paradocs/field_dsl.rb', line 8

def required
  policy :required
end

#transparentObject



28
29
30
# File 'lib/paradocs/field_dsl.rb', line 28

def transparent
  meta transparent: true
end

#whitelistedObject



24
25
26
# File 'lib/paradocs/field_dsl.rb', line 24

def whitelisted
  policy :whitelisted
end