aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGuillaume2017-09-21 11:46:35 +0200
committerGuillaume2017-09-21 11:46:35 +0200
commit8ed6de7a0fa07ba05488e5fedb420be438ebc063 (patch)
tree00579b1a25b3052f73c186080934b40823d2ce3d /app
parentd59ec1b714ab55b0a66f3cfec5297c4baf9d47aa (diff)
parent5c63e10c3f576254d28a2bfff0b5dbbd0dd8e2d5 (diff)
downloadchouette-core-8ed6de7a0fa07ba05488e5fedb420be438ebc063.tar.bz2
Merge branch 'master' of https://github.com/af83/stif-boiv
Diffstat (limited to 'app')
-rw-r--r--app/models/generic_attribute_pattern.rb23
-rw-r--r--app/models/generic_attribute_uniqueness.rb23
-rw-r--r--app/models/journey_pattern_control/vehicle_journey.rb13
-rw-r--r--app/models/line_control/route.rb13
-rw-r--r--app/models/route_control/journey_pattern.rb13
-rw-r--r--app/models/route_control/opposite_route_terminus.rb13
-rw-r--r--app/models/routing_constaint_zone_control/maximum_length.rb13
-rw-r--r--app/models/routing_constaint_zone_control/minimum_length.rb13
8 files changed, 124 insertions, 0 deletions
diff --git a/app/models/generic_attribute_pattern.rb b/app/models/generic_attribute_pattern.rb
new file mode 100644
index 000000000..0043f1563
--- /dev/null
+++ b/app/models/generic_attribute_pattern.rb
@@ -0,0 +1,23 @@
+#module ComplianceControls
+
+ class GenericAttributePattern < ComplianceControl
+
+ hstore_accessor :control_attributes, value: :string, pattern: :string
+
+ @@default_criticity = :warning
+ @@default_code = "3-Generic-3"
+
+ validate :pattern_match
+ def pattern_match
+ true
+ end
+
+ after_initialize do
+ self.name = 'GenericAttributeMinMax'
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+
+ end
+
+#end \ No newline at end of file
diff --git a/app/models/generic_attribute_uniqueness.rb b/app/models/generic_attribute_uniqueness.rb
new file mode 100644
index 000000000..dcf4a16c2
--- /dev/null
+++ b/app/models/generic_attribute_uniqueness.rb
@@ -0,0 +1,23 @@
+#module ComplianceControls
+
+ class GenericAttributeUniqueness < ComplianceControl
+
+ hstore_accessor :control_attributes, name: :string
+
+ @@default_criticity = :warning
+ @@default_code = "3-Generic-3"
+
+ validate :unique_values
+ def unique_values
+ true
+ end
+
+ after_initialize do
+ self.name = 'GenericAttributeMinMax'
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+
+ end
+
+#end \ No newline at end of file
diff --git a/app/models/journey_pattern_control/vehicle_journey.rb b/app/models/journey_pattern_control/vehicle_journey.rb
new file mode 100644
index 000000000..a90c16138
--- /dev/null
+++ b/app/models/journey_pattern_control/vehicle_journey.rb
@@ -0,0 +1,13 @@
+module JourneyPatternControl
+ class VehicleJourney < ComplianceControl
+
+ @@default_criticity = :warning
+ @@default_code = "3-JourneyPattern-2"
+
+ after_initialize do
+ self.name = self.class.name
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+ end
+end \ No newline at end of file
diff --git a/app/models/line_control/route.rb b/app/models/line_control/route.rb
new file mode 100644
index 000000000..8ac13a080
--- /dev/null
+++ b/app/models/line_control/route.rb
@@ -0,0 +1,13 @@
+module LineControl
+ class Route < ComplianceControl
+
+ @@default_criticity = :warning
+ @@default_code = "3-Line-1"
+
+ after_initialize do
+ self.name = self.class.name
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+ end
+end \ No newline at end of file
diff --git a/app/models/route_control/journey_pattern.rb b/app/models/route_control/journey_pattern.rb
new file mode 100644
index 000000000..0559fac42
--- /dev/null
+++ b/app/models/route_control/journey_pattern.rb
@@ -0,0 +1,13 @@
+module RouteControl
+ class JourneyPattern < ComplianceControl
+
+ @@default_criticity = :warning
+ @@default_code = "3-Route-3"
+
+ after_initialize do
+ self.name = self.class.name
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+ end
+end \ No newline at end of file
diff --git a/app/models/route_control/opposite_route_terminus.rb b/app/models/route_control/opposite_route_terminus.rb
new file mode 100644
index 000000000..e72229ca3
--- /dev/null
+++ b/app/models/route_control/opposite_route_terminus.rb
@@ -0,0 +1,13 @@
+module RouteControl
+ class OppositeRouteTerminus < ComplianceControl
+
+ @@default_criticity = :warning
+ @@default_code = "3-Route-5"
+
+ after_initialize do
+ self.name = self.class.name
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+ end
+end \ No newline at end of file
diff --git a/app/models/routing_constaint_zone_control/maximum_length.rb b/app/models/routing_constaint_zone_control/maximum_length.rb
new file mode 100644
index 000000000..fd63ffeda
--- /dev/null
+++ b/app/models/routing_constaint_zone_control/maximum_length.rb
@@ -0,0 +1,13 @@
+module RoutingConstaintZoneControl
+ class MaximumLength < ComplianceControl
+
+ @@default_criticity = :warning
+ @@default_code = "3-ITL-2"
+
+ after_initialize do
+ self.name = self.class.name
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+ end
+end \ No newline at end of file
diff --git a/app/models/routing_constaint_zone_control/minimum_length.rb b/app/models/routing_constaint_zone_control/minimum_length.rb
new file mode 100644
index 000000000..c17bbc834
--- /dev/null
+++ b/app/models/routing_constaint_zone_control/minimum_length.rb
@@ -0,0 +1,13 @@
+module RoutingConstaintZoneControl
+ class MinimumLength < ComplianceControl
+
+ @@default_criticity = :warning
+ @@default_code = "3-ITL-3"
+
+ after_initialize do
+ self.name = self.class.name
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+ end
+end \ No newline at end of file