Class: Mir::Yuv

Inherits:
Object
  • Object
show all
Defined in:
lib/mir/01_model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(y, u, v) ⇒ Yuv

Returns a new instance of Yuv.



36
37
38
# File 'lib/mir/01_model.rb', line 36

def initialize y,u,v
  @y,@u,@v=y,u,v
end

Instance Attribute Details

#uObject

Returns the value of attribute u.



35
36
37
# File 'lib/mir/01_model.rb', line 35

def u
  @u
end

#vObject

Returns the value of attribute v.



35
36
37
# File 'lib/mir/01_model.rb', line 35

def v
  @v
end

#yObject

Returns the value of attribute y.



35
36
37
# File 'lib/mir/01_model.rb', line 35

def y
  @y
end

Instance Method Details

#to_aObject



39
40
41
# File 'lib/mir/01_model.rb', line 39

def to_a
  [self.y,self.u,self.v]
end

#to_sObject



42
43
44
# File 'lib/mir/01_model.rb', line 42

def to_s
  "(#{y.to_s.rjust(3)},#{u.to_s.rjust(3)},#{v.to_s.rjust(3)})"
end