Module: Textus::Contract
- Defined in:
- lib/textus/contract.rb,
lib/textus/contract/arg.rb,
lib/textus/contract/dsl.rb,
lib/textus/contract/spec.rb
Defined Under Namespace
Modules: DSL Classes: Arg, Spec
Constant Summary collapse
- JSON_TYPES =
{ String => "string", Integer => "integer", Hash => "object", Array => "array", :boolean => "boolean" }.freeze
Class Method Summary collapse
Class Method Details
.json_type(type) ⇒ Object
8 9 10 |
# File 'lib/textus/contract.rb', line 8 def self.json_type(type) JSON_TYPES.fetch(type) { raise ArgumentError.new("no JSON type mapping for #{type.inspect}") } end |