Class: Ray::GL::Vertex::Instance

Inherits:
Object
  • Object
show all
Includes:
PP
Defined in:
lib/ray/gl/vertex.rb,
ext/gl_vertex.c

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from PP

#pretty_print_attributes

Class Attribute Details

.instance_classesObject (readonly)

Returns the value of attribute instance_classes.



14
15
16
# File 'lib/ray/gl/vertex.rb', line 14

def instance_classes
  @instance_classes
end

Class Method Details

.layoutObject



17
18
19
# File 'lib/ray/gl/vertex.rb', line 17

def self.layout
  @vertex_instance_layout
end

Instance Method Details

#pretty_print(q) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/ray/gl/vertex.rb', line 30

def pretty_print(q)
  attr = []
  self.class.layout.each do |key, _, _, per_instance|
    attr << key if per_instance
  end

  pretty_print_attributes q, attr
end

#to_sObject



21
22
23
24
25
26
27
28
# File 'lib/ray/gl/vertex.rb', line 21

def to_s
  pairs = []
  self.class.layout.each do |key, _, _, per_instance|
    pairs << "#{key}=#{send(key)}" if per_instance
  end

  "#<#{self.class} #{pairs.join " "}>"
end