Class: TSJSON::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/types/base.rb

Instance Method Summary collapse

Instance Method Details

#compileObject



9
# File 'lib/types/base.rb', line 9

def compile; end

#index(name) ⇒ Object



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

def index(name)
  raise "Can't access index #{name} of #{self.class.name}"
end

#property(name) ⇒ Object



11
12
13
# File 'lib/types/base.rb', line 11

def property(name)
  raise "Can't access property #{name} of #{self.class.name}"
end

#valid?(value) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
# File 'lib/types/base.rb', line 3

def valid?(value)
  validate(value)
rescue ValidationError
  false
end