Class: Jan::Symbol::Band

Inherits:
Object
  • Object
show all
Defined in:
lib/jan/symbol/band.rb,
lib/jan/symbol/band/bar.rb,
lib/jan/symbol/band/space.rb

Direct Known Subclasses

Bar, Space

Defined Under Namespace

Classes: Bar, Space

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width, color:) ⇒ Band

Returns a new instance of Band.

Parameters:

  • width (Integer)
  • color (String)


9
10
11
12
# File 'lib/jan/symbol/band.rb', line 9

def initialize(width, color:)
  @width = width
  @color = color
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



14
15
16
# File 'lib/jan/symbol/band.rb', line 14

def color
  @color
end

#widthObject (readonly)

Returns the value of attribute width.



14
15
16
# File 'lib/jan/symbol/band.rb', line 14

def width
  @width
end

Instance Method Details

#==(other) ⇒ boolean

Parameters:

Returns:

  • (boolean)


18
19
20
# File 'lib/jan/symbol/band.rb', line 18

def ==(other)
  self.width == other.width && self.color == other.color
end