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
- #as(identifier) ⇒ Object
- #declared ⇒ Object
- #description(text) ⇒ Object
- #example(value) ⇒ Object
- #length(opts) ⇒ Object
- #options(opts) ⇒ Object
- #present ⇒ Object
- #required ⇒ Object
- #transparent ⇒ Object
- #whitelisted ⇒ Object
Instance Method Details
#as(identifier) ⇒ Object
40 41 42 |
# File 'lib/paradocs/field_dsl.rb', line 40 def as(identifier) alias: identifier end |
#declared ⇒ Object
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) description: text end |
#example(value) ⇒ Object
44 45 46 |
# File 'lib/paradocs/field_dsl.rb', line 44 def example(value) 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 (opts) policy :options, opts end |
#present ⇒ Object
12 13 14 |
# File 'lib/paradocs/field_dsl.rb', line 12 def present required.policy :present end |
#required ⇒ Object
8 9 10 |
# File 'lib/paradocs/field_dsl.rb', line 8 def required policy :required end |
#transparent ⇒ Object
28 29 30 |
# File 'lib/paradocs/field_dsl.rb', line 28 def transparent transparent: true end |
#whitelisted ⇒ Object
24 25 26 |
# File 'lib/paradocs/field_dsl.rb', line 24 def whitelisted policy :whitelisted end |