decode 0.23.1 → 0.23.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ae94375f9288ad2aa541ed744d7fb51b86da0bb83d77a019e17c6c31ac9f2cf
4
- data.tar.gz: 74e3bfe6b181464eb8406ba684aee902b5519ae48d960f9e2bb6a79fffe1917d
3
+ metadata.gz: 624c9e07afc43e3c54cbf3e8bb7108c092082e96a43bbcca0f815bce273070ec
4
+ data.tar.gz: 9c9a1d112155a53d17b570369a2bc9b1005e826e7891998ee6e2957283385f7d
5
5
  SHA512:
6
- metadata.gz: '089969a2909633681778781ef8047e262cc4f4405f04a2adb72dbeb73f818fa8a6a4f177573fa4077eee1a9892b4995dc24cbff2dc46aacd0343422af5a16df8'
7
- data.tar.gz: 8d9133f1d02b98af77c6bbd3fbf26c93d01c9be4614eedefc6e4c731aa077103dda30a484a6ac0ddbbbc45b3fce76c3c5d49559a3563b09dfba29723fc38ace5
6
+ metadata.gz: a9a85bd2c447f56b9ef17a9dae369d044f6807682d30152902005a4a2132141597859036a2e6eecda18fc7582666bf6a389d90230f1b7d41a9c8a529193fbf60
7
+ data.tar.gz: e4775c9c24aa0eaa4c6ec0d6da3bc6866395645703a5e810ee61d87b61db88f159bde44859833eb63aa5fedb9dd947d3c20b5264810f3a95c531d04f837e7440
checksums.yaml.gz.sig CHANGED
Binary file
@@ -54,7 +54,7 @@ module Decode
54
54
  class Singleton < Definition
55
55
  # Generate a nested name for the singleton class.
56
56
  def nested_name
57
- "::class"
57
+ "class"
58
58
  end
59
59
 
60
60
  # A singleton class is a container for other definitions.
@@ -65,8 +65,8 @@ module Decode
65
65
  # Get the location of this definition.
66
66
  # @returns [Location | Nil] The location object if source is available.
67
67
  def location
68
- if @source
69
- Location.new(@source.path, @node.location.start_line)
68
+ if @source and location = @node&.location
69
+ Location.new(@source.path, location.start_line)
70
70
  end
71
71
  end
72
72
  end
@@ -113,7 +113,11 @@ module Decode
113
113
  if name = singleton_name_for(node)
114
114
  definition = Singleton.new(name,
115
115
  comments: comments_for(node),
116
- parent: parent, language: @language, visibility: :public, source: source
116
+ parent: parent,
117
+ node: node,
118
+ language: @language,
119
+ visibility: :public,
120
+ source: source
117
121
  )
118
122
 
119
123
  yield definition
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2020-2024, by Samuel Williams.
5
5
 
6
6
  module Decode
7
- VERSION = "0.23.1"
7
+ VERSION = "0.23.3"
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.1
4
+ version: 0.23.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file