stave 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dbd5c1307918d3c9af4689f6126d374ab8d7a31b03777f0bc3e9a32cf127188
4
- data.tar.gz: 985afcf77f58ea34b29e1f16f3ee98b01b711ae2701d0c7f0b084586ca553b64
3
+ metadata.gz: 0cf07a51299c29e08fc087a57c7956dfbef43c06ef913fdda11bdcbe67ef40ff
4
+ data.tar.gz: 353ec540396d0e6d0031c43ab3915684f79b532455ed74c979c485caeaca47f7
5
5
  SHA512:
6
- metadata.gz: 0d318f7a0cf99045f8e7191734c8d0adb6f41af1d7fc0d63e91176ca2c60328cbe8c731011a2697736068bf0e4326d6032eb287ee818928ef06f900fdb2326b9
7
- data.tar.gz: 26f57ce7d59c8b333c2f4db3988763eb46c1ec1ab2c36cea23df1ac387ebd2104fc15e24293fe41929f37c3018136fc0c84701e78fc55b734952344ee8ea5d0a
6
+ metadata.gz: f0bb69f03b3aac8f5ddaadb4e305d3c27d90b8a2d85796a64032b8d45a75d3947d6987a13b6d423351a92ca689d3726d3fbfae5962904936095c88d477559311
7
+ data.tar.gz: 919b81b27591ff1b08de445a66b3860b3d73e79b2fb298935308fa5117c4d47c7fde511056d421e5076f1ab11e3db694e09afe361f2129023c5537dc3d40f910
@@ -1,6 +1,10 @@
1
1
  module Stave
2
2
  module Core
3
3
  class NoteCollection
4
+ extend Forwardable
5
+
6
+ def_delegators :type, :degrees
7
+
4
8
  attr_reader :root, :type
5
9
 
6
10
  def initialize(root:, type:)
@@ -20,6 +24,14 @@ module Stave
20
24
  notes[position - 1]
21
25
  end
22
26
 
27
+ def note_degree(note)
28
+ return unless notes.include?(note)
29
+
30
+ position = notes.index(note)
31
+
32
+ degrees[position]
33
+ end
34
+
23
35
  def uniq
24
36
  notes.uniq(&:variant)
25
37
  end
@@ -112,6 +112,10 @@ module Stave
112
112
 
113
113
  Degree.find_by(interval: new_interval)
114
114
  end
115
+
116
+ def self.non_root
117
+ variants.reject { |degree| degree.position == 1 }
118
+ end
115
119
  end
116
120
  end
117
121
  end
data/lib/stave/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Stave
2
- VERSION = "0.1.2".freeze
2
+ VERSION = "0.1.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stave
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Welham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-12 00:00:00.000000000 Z
11
+ date: 2024-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk