live 0.16.0 → 0.17.0

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: 960ab85523261e6aed7869a0bdaf9d0287b78a1582f7a45ed5d7de9d664fb1bb
4
- data.tar.gz: '0848d0c2cc6c14702eb886a7eb719bf81e15e51f52b8500e736602743860213c'
3
+ metadata.gz: 9e821b6c491dfd6033b870fa426fd43b0e0e14c3bb19d9a77796d991f3263c84
4
+ data.tar.gz: 529f78570c91e31ba58ad95651a534586c630e4f1cfd46fef05070bf544b161a
5
5
  SHA512:
6
- metadata.gz: aa1822962cb839eac75ae7cef53abd80d3ede0bfb12d0844520aa1862328c0be64ea77df95388f12acb4d29b19005a872df7d008d50582ea28c6e22ba291063e
7
- data.tar.gz: d4450a385662da48c87b2ed7f586ade4b44f2019889bf62a883edfedcf61a6397b44e7430e3a1a089e689558950d27027b4244932f4d252d99d793987f2ed54a
6
+ metadata.gz: 174e05351add100c37874f34e0527c331886c13a02144d98a558d51e48758f425403cd4855b43d0e801d006b8d27e9e73fa0df15bda1c2501cb500be013a87d1
7
+ data.tar.gz: eff442c283edf136bb43ee8fa0b5ce398fbb608a5f28ccc16fc9fcbe15be5d9b4cb5349835e6897e6002d312b99a0f95bc3f5ec604d1e01a28fa965c3c9de3b6
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/live/element.rb CHANGED
@@ -16,19 +16,23 @@ module Live
16
16
  SecureRandom.uuid
17
17
  end
18
18
 
19
+ # Create a new root element with a convenient syntax for specifying the id and data.
20
+ #
21
+ # @parameter id [String] The unique identifier within the page.
22
+ # @parameter data [Hash] The data associated with the element, typically stored as `data-` attributes.
23
+ def self.root(id = self.unique_id, **data)
24
+ self.new(id, data)
25
+ end
26
+
19
27
  # Mount an element within a parent element.
20
- def self.mount(parent, id, data = {})
28
+ def self.child(parent, id = self.unique_id, **data)
21
29
  full_id = parent.id + ":" + id
22
30
 
23
31
  self.new(full_id, data)
24
32
  end
25
33
 
26
- # Create a new element with a convenient syntax for specifying the id and data.
27
- #
28
- # @parameter id [String] The unique identifier within the page.
29
- # @parameter data [Hash] The data associated with the element, typically stored as `data-` attributes.
30
- def self.[](id = self.unique_id, **data)
31
- self.new(id, data)
34
+ def self.mount(parent, id, data = {})
35
+ self.child(parent, id, **data)
32
36
  end
33
37
 
34
38
  # Initialize the element with the specified id and data.
data/lib/live/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2021-2024, by Samuel Williams.
5
5
 
6
6
  module Live
7
- VERSION = "0.16.0"
7
+ VERSION = "0.17.0"
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: live
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file