Class: TJSON::DataType::NonScalar

Inherits:
TJSON::DataType show all
Defined in:
lib/tjson/datatype.rb

Overview

Non-scalar types

Direct Known Subclasses

Array, Object, Set

Constant Summary

Constants inherited from TJSON::DataType

TAGS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from TJSON::DataType

[], #convert, #generate, generate, identify_type, parse, #tag

Constructor Details

#initialize(inner_type) ⇒ NonScalar

Returns a new instance of NonScalar.



75
76
77
# File 'lib/tjson/datatype.rb', line 75

def initialize(inner_type)
  @inner_type = inner_type
end

Instance Attribute Details

#inner_typeObject (readonly)

Returns the value of attribute inner_type.



73
74
75
# File 'lib/tjson/datatype.rb', line 73

def inner_type
  @inner_type
end

Instance Method Details

#==(other) ⇒ Object



87
88
89
# File 'lib/tjson/datatype.rb', line 87

def ==(other)
  self.class == other.class && inner_type == other.inner_type
end

#inspectObject



79
80
81
# File 'lib/tjson/datatype.rb', line 79

def inspect
  "#<#{self.class}<#{@inner_type.inspect}>>"
end

#scalar?Boolean

Returns:

  • (Boolean)


83
84
85
# File 'lib/tjson/datatype.rb', line 83

def scalar?
  false
end