Class: VORuby::STC::V1_30::PixelType

Inherits:
Object
  • Object
show all
Includes:
SerializableToXml
Defined in:
lib/voruby/stc/1.30/stc.rb

Overview

A type that just holds a 1-3D pixel value.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(pixel) ⇒ PixelType

Returns a new instance of PixelType.



1392
1393
1394
# File 'lib/voruby/stc/1.30/stc.rb', line 1392

def initialize(pixel)
  self.pixel = pixel
end

Instance Attribute Details

#pixelObject

Returns the value of attribute pixel.



1390
1391
1392
# File 'lib/voruby/stc/1.30/stc.rb', line 1390

def pixel
  @pixel
end

Class Method Details

.from_xml(xml) ⇒ Object



1413
1414
1415
1416
# File 'lib/voruby/stc/1.30/stc.rb', line 1413

def self.from_xml(xml)
  root = element_from(xml)
  self.new(xml_to_obj(root, Pixel, true))
end

Instance Method Details

#==(p) ⇒ Object



1402
1403
1404
# File 'lib/voruby/stc/1.30/stc.rb', line 1402

def ==(p)
  self.pixel == p.pixel
end

#to_xml(name = nil) ⇒ Object



1406
1407
1408
1409
1410
1411
# File 'lib/voruby/stc/1.30/stc.rb', line 1406

def to_xml(name=nil)
  el = element(name)
  el.add_element(self.pixel.to_xml)
  collapse_namespaces(el)
  el
end