Class: VORuby::Resources::VODataService::V1_0::ArrayShape

Inherits:
Object
  • Object
show all
Includes:
XML::Mapping
Defined in:
lib/voruby/resources/vodataservice/vodataservice_v1_0.rb,
lib/voruby/resources/vodataservice/vodataservice_v1_0.rb

Overview

An expression of a the shape of a multi-dimensional array of the form LxNxM… where each value between gives the integer length of the array along a dimension. An asterisk (*) as the last dimension of the shape indicates that the length of the last axis is variable or undetermined.

Instance Method Summary collapse

Instance Method Details

#value=(shape) ⇒ Object

Raises:

  • (RuntimeError)


44
45
46
47
48
# File 'lib/voruby/resources/vodataservice/vodataservice_v1_0.rb', line 44

def value=(shape)
  raise RuntimeError, "ArrayShape '#{shape}' in wrong format" if !shape.match(/^([0-9]+x)*[0-9]*[*]?$/)

  @value = shape
end