Class: ScaleRb::PortableRegistry

Inherits:
Object
  • Object
show all
Extended by:
TypeEnforcer
Includes:
Types
Defined in:
lib/scale_rb/portable_registry.rb

Constant Summary

Constants included from Types

Types::DecodeResult, Types::HashMap, Types::Hex, Types::PortableType, Types::Primitive, Types::Registry, Types::Ti, Types::TypedArray, Types::U8, Types::U8Array, Types::UnsignedInteger, Types::VariantKind

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TypeEnforcer

__, extended, method_added

Constructor Details

#initialize(data) ⇒ PortableRegistry

Returns a new instance of PortableRegistry.



12
13
14
15
16
# File 'lib/scale_rb/portable_registry.rb', line 12

def initialize(data)
  @data = data
  @types = ::Array.new(@data.size)
  build_types
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



9
10
11
# File 'lib/scale_rb/portable_registry.rb', line 9

def data
  @data
end

#typesObject (readonly)

Returns the value of attribute types.



9
10
11
# File 'lib/scale_rb/portable_registry.rb', line 9

def types
  @types
end

Instance Method Details

#[](index) ⇒ Object



19
20
21
# File 'lib/scale_rb/portable_registry.rb', line 19

def [](index)
  @types[index]
end

#inspectObject



23
24
25
# File 'lib/scale_rb/portable_registry.rb', line 23

def inspect
  "a_portable_registry"
end