foobara 0.0.127 → 0.0.128

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: 531c75e332f6e7cc297b0b56689d91f59737040fe533814a8b780defc937b2aa
4
- data.tar.gz: 16dd8725423abe9155c1fd5b89c752271ce568ec83cca52c7654204ee114f559
3
+ metadata.gz: cb5fc138339eebd7dc6aafbe379a85ee8ea0a5f2d6dbd89b2e2fa590de679d26
4
+ data.tar.gz: 1b706dfa3167fa9c67560b5f832da6dfa7b1608abb7f4f511ca5ffa82821b8d5
5
5
  SHA512:
6
- metadata.gz: 9c97ed1f00a114ea3ff8e1932cb32a13e8e538b1a0dc694f542060febafcae9e515e4888695cdbeede192e490ea280e6bddf8bf54b64e6339fe7adeaaeaa42a1
7
- data.tar.gz: 4e414afd9090bc83685ce1b2e30fb31948963f4d57cff4d77ba4aa698547e716fd5a562442845f60cd8e6affb06263797fcf0c539a7f5478fceb9dec6b1412de
6
+ metadata.gz: c71ac160e871eec0503faa700ebc08b38af97bdb9b55ed285802db7914e4c48289cd2130543963087e3c1d51e29515ab73f1d4295b02f1738ce84dd786fb3b75
7
+ data.tar.gz: 55b37e7df5376fd8f840f74c7c2c7077bac73da827ff4b4426db4be8fb6fa4376095b1bb657be0e4ba85d9671b3a6b371be30a95afb9086f35db554d87f00717
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # [0.0.128] - 2025-05-29
2
+
3
+ - Add StateMachine.for convenience method
4
+
1
5
  # [0.0.127] - 2025-05-25
2
6
 
3
7
  - Add better support for using ruby classes as types
@@ -3,6 +3,8 @@ module Foobara
3
3
  require_project_file("state_machine", "callbacks")
4
4
  require_project_file("state_machine", "validations")
5
5
 
6
+ # TODO: allow quick creation of a statemachine either through better options to #initialize or a
7
+ # .for method.
6
8
  class StateMachine
7
9
  include Sugar
8
10
  include Callbacks
@@ -32,6 +34,13 @@ module Foobara
32
34
  create_can_methods
33
35
  create_register_callback_methods
34
36
  end
37
+
38
+ def for(transition_map)
39
+ klass = Class.new(self)
40
+
41
+ klass.set_transition_map(transition_map)
42
+ klass
43
+ end
35
44
  end
36
45
 
37
46
  attr_accessor :target_attribute, :owner
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.127
4
+ version: 0.0.128
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-26 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bigdecimal
@@ -529,7 +529,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
529
529
  - !ruby/object:Gem::Version
530
530
  version: '0'
531
531
  requirements: []
532
- rubygems_version: 3.6.2
532
+ rubygems_version: 3.6.7
533
533
  specification_version: 4
534
534
  summary: A command-centric and discoverable software framework with a focus on domain
535
535
  concepts and abstracting away integration code