Sha256: c3cc3cff9c353220fd16f3a76ffdfbe7b59e9c841833aa987984d4a13c2d7926
Contents?: true
Size: 664 Bytes
Versions: 2
Compression:
Stored size: 664 Bytes
Contents
class Restspec::Schema::Types::BasicType def initialize(options = {}) self.options = options end def |(other_type) self.disjuction = other_type self end def of(other_type) self.parameterized_type = other_type self end def totally_valid?(attribute, value) if disjuction.present? valid?(attribute, value) || disjuction.valid?(attribute, value) else valid?(attribute, value) end end private attr_accessor :options, :disjuction, :parameterized_type def example_options options.fetch(:example_options, options) end def schema_options options.fetch(:schema_options, options) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
restspec-0.0.2 | lib/restspec/schema/types/basic_type.rb |
restspec-0.0.1 | lib/restspec/schema/types/basic_type.rb |