clipsruby 0.0.27 → 0.0.28

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/ext/clipsruby/clipsruby.c +20 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78727d42b56ea442a2ff5b487d3cc209bcfda2068724a7507021fa44845dee9c
4
- data.tar.gz: f22f44dc57cdf4d8e1491b1b9790c45a15264b9fcad34b3b768e6deb9655a475
3
+ metadata.gz: c3422d24e21cf31d89d413801a5804b91bdca8cfab4adc230bcdaeb6d4da3085
4
+ data.tar.gz: f34d498c8130445406058e05073abe0d48cc7c7a1c2fe5b4e2fb799bf4836f7a
5
5
  SHA512:
6
- metadata.gz: abd28dcfe9303c838636a209fdcd1d043ae7c0fa72b84ae49ea52c2e79aed9f2d65c58cd02746cdfd9bc4230476dcb4289ea32cc36f2e335ba54371008146e3b
7
- data.tar.gz: a9dd833a9d045713eb20ab356d65bb80c7a61d528518f5b7dd83482a059042a3499f3fb33f06259ab667af3fc2dea22102bcb103acf50f41900537301980d5d0
6
+ metadata.gz: 9b22a805380544262da7bf544c163159a5b5846a8ce2c0da2754f2bcdabaea6c8209cf6c5b8154606bb14498a38e0fac9751e51926e03cddab7f120018905291
7
+ data.tar.gz: f13099a933300723e7e1062d6c4e144e286726476e942f172457cbc38c6e4957f982caf007cf0acbdb41b2a0c7713ce494712794670883a934580a4fd101b556
data/README.md CHANGED
@@ -312,6 +312,16 @@ CLIPS::Environment::Fact.pp_form(fact)
312
312
  fact.pp_form
313
313
  ```
314
314
 
315
+ ### `CLIPS::Environment::Fact.existp`
316
+ ### `CLIPS::Environment::Fact#existp`
317
+
318
+ Returns a boolean representing whether or not a Fact has been retracted
319
+
320
+ ```ruby
321
+ CLIPS::Environment::Fact.existp(fact)
322
+ fact.existp
323
+ ```
324
+
315
325
  ### `CLIPS::Environment::Fact.to_h`
316
326
  ### `CLIPS::Environment::Fact#to_h`
317
327
 
@@ -1796,6 +1796,24 @@ static VALUE clips_environment_fact_static_pp_form(int argc, VALUE *argv, VALUE
1796
1796
  return toReturn;
1797
1797
  }
1798
1798
 
1799
+ static VALUE clips_environment_fact_existp(VALUE self)
1800
+ {
1801
+ Fact *fact;
1802
+
1803
+ TypedData_Get_Struct(self, Fact, &Fact_type, fact);
1804
+
1805
+ if (FactExistp(fact)) {
1806
+ return Qtrue;
1807
+ } else {
1808
+ return Qfalse;
1809
+ }
1810
+ }
1811
+
1812
+ static VALUE clips_environment_fact_static_existp(VALUE self, VALUE rbFact)
1813
+ {
1814
+ return clips_environment_fact_existp(rbFact);
1815
+ }
1816
+
1799
1817
  static VALUE clips_environment_get_fact_list(int argc, VALUE *argv, VALUE rbEnvironment) {
1800
1818
  VALUE defmodule_or_defmodule_name;
1801
1819
  Environment *env;
@@ -3115,6 +3133,8 @@ void Init_clipsruby(void)
3115
3133
  rb_define_method(rbFact, "index", clips_environment_fact_index, 0);
3116
3134
  rb_define_singleton_method(rbFact, "pp_form", clips_environment_fact_static_pp_form, -1);
3117
3135
  rb_define_method(rbFact, "pp_form", clips_environment_fact_pp_form, -1);
3136
+ rb_define_singleton_method(rbFact, "existp", clips_environment_fact_static_existp, 1);
3137
+ rb_define_method(rbFact, "existp", clips_environment_fact_existp, 0);
3118
3138
 
3119
3139
  VALUE rbDefrule = rb_define_class_under(rbEnvironment, "Defrule", rb_cObject);
3120
3140
  rb_define_alloc_func(rbDefrule, defrule_alloc);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clipsruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.27
4
+ version: 0.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Johnston
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-18 00:00:00.000000000 Z
11
+ date: 2024-09-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Calling the CLIPS programming language from within Ruby
14
14
  email: mrryanjohnston@gmail.com