Module: Paramore

Defined in:
lib/paramore.rb,
lib/paramore/cli.rb,
lib/paramore/field.rb,
lib/paramore/types.rb,
lib/paramore/railtie.rb,
lib/paramore/validate.rb,
lib/paramore/extension.rb,
lib/paramore/configuration.rb,
lib/paramore/cast_parameters.rb,
lib/paramore/permitted_parameter_argument.rb

Defined Under Namespace

Modules: BigDecimal, Boolean, Cli, Date, Extension, File, Float, Int, PermittedParameterArgument, SanitizedString, String, StrippedString, TypeRegexes, Validate Classes: ArrayExpected, CastParameters, Configuration, Field, HashExpected, HashTooWild, NilParameter, NonField, Railtie

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject (readonly)

Returns the value of attribute configuration.



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

def configuration
  @configuration
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



15
16
17
# File 'lib/paramore.rb', line 15

def self.configure
  yield(configuration)
end

.ErrorFieldName(name) ⇒ Object



31
32
33
# File 'lib/paramore/errors.rb', line 31

def Paramore::ErrorFieldName(name)
  name.present? ? "`#{name}`" : 'root field'
end

.field(given_type, options = {}) ⇒ Object



19
20
21
22
23
24
# File 'lib/paramore.rb', line 19

def self.field(given_type, options = {})
  Paramore::Field.new(
    given_type,
    **Paramore::Field::DEFAULT_OPTIONS.merge(options)
  ).validate!
end