Class JCON::Types::SimpleType
In: lib/jcon/conformance.rb
lib/jcon/types.rb
Parent: Type

Methods

contains?   new   to_s  

Attributes

name  [R] 

Public Class methods

[Source]

    # File lib/jcon/types.rb, line 19
19:       def initialize(name, &block)
20:         name = name.intern if name.is_a?(String)
21:         @name = name
22:         @test = block
23:       end

Public Instance methods

[Source]

    # File lib/jcon/conformance.rb, line 4
 4:       def contains?(value)
 5:         if not @test and context and@context[name]
 6:           return context[name].contains?(value)
 7:         end
 8:         raise "No definition for #{self}" unless @test
 9:         @test.call(value)
10:       end

[Source]

    # File lib/jcon/types.rb, line 25
25:       def to_s; name.to_s; end

[Validate]