Class: TypeWrappers::AETypeBase

Inherits:
Object
  • Object
show all
Defined in:
lib/_aem/typewrappers.rb

Direct Known Subclasses

AEEnum, AEKey, AEProp, AEType

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ AETypeBase

Returns a new instance of AETypeBase.



13
14
15
16
17
18
# File 'lib/_aem/typewrappers.rb', line 13

def initialize(code)
  if not(code.is_a?(String) and code.length == 4)
    raise ArgumentError, "Code must be a four-character string: #{code.inspect}"
  end
  @code = code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



11
12
13
# File 'lib/_aem/typewrappers.rb', line 11

def code
  @code
end

Instance Method Details

#==(val) ⇒ Object Also known as: eql?



24
25
26
# File 'lib/_aem/typewrappers.rb', line 24

def ==(val)
  return (self.equal?(val) or (val.class == self.class and val.code == @code))
end

#hashObject



20
21
22
# File 'lib/_aem/typewrappers.rb', line 20

def hash
  return @code.hash
end

#inspectObject



34
35
36
# File 'lib/_aem/typewrappers.rb', line 34

def inspect
  return to_s
end

#to_sObject



30
31
32
# File 'lib/_aem/typewrappers.rb', line 30

def to_s
  return "AEM::#{self.class::Name}.new(#{@code.inspect})"
end