Class: Instrumental::Notice

Inherits:
Struct
  • Object
show all
Defined in:
lib/instrumental/command_structs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(note, time, duration) ⇒ Notice

Returns a new instance of Notice.



24
25
26
# File 'lib/instrumental/command_structs.rb', line 24

def initialize(note, time, duration)
  super(note, time.to_i, duration.to_i)
end

Instance Attribute Details

#durationObject

Returns the value of attribute duration

Returns:

  • (Object)

    the current value of duration



23
24
25
# File 'lib/instrumental/command_structs.rb', line 23

def duration
  @duration
end

#noteObject

Returns the value of attribute note

Returns:

  • (Object)

    the current value of note



23
24
25
# File 'lib/instrumental/command_structs.rb', line 23

def note
  @note
end

#timeObject

Returns the value of attribute time

Returns:

  • (Object)

    the current value of time



23
24
25
# File 'lib/instrumental/command_structs.rb', line 23

def time
  @time
end

Instance Method Details

#to_sObject



28
29
30
# File 'lib/instrumental/command_structs.rb', line 28

def to_s
  ["notice".freeze, time, duration, note].map(&:to_s).join(" ")
end