Class: Dither::Param

Inherits:
Struct
  • Object
show all
Defined in:
lib/dither/param.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#iObject

Returns the value of attribute i

Returns:

  • (Object)

    the current value of i



3
4
5
# File 'lib/dither/param.rb', line 3

def i
  @i
end

#jObject

Returns the value of attribute j

Returns:

  • (Object)

    the current value of j



3
4
5
# File 'lib/dither/param.rb', line 3

def j
  @j
end

Instance Method Details

#<=>(param) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/dither/param.rb', line 4

def <=>(param)
  return 1 if param.unbound?

  a = i <=> param.i
  if a == 0
    return j <=> param.j
  else
    return a
  end
end

#unbound?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/dither/param.rb', line 15

def unbound?
  false
end