aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stif
diff options
context:
space:
mode:
authorRobert2017-11-27 10:07:30 +0100
committerRobert2017-12-14 15:34:46 +0100
commit695d6604f12515507e2e8d435370d30df5fc820d (patch)
treeafbb8919268ea2a5cd96b232d64eb7dbc108de34 /lib/stif
parent1eacdd594ec0079372c7e8d0c32d283e2a20a05c (diff)
downloadchouette-core-695d6604f12515507e2e8d435370d30df5fc820d.tar.bz2
Refs: #5006@3h;
Working out how to check for allowed lines vs. foreign lines - Implement allowed_lines as `Organisation#lines_set` - Pushed line_id related stuff into `lib/stif/codif_line_id.rb` - Related Specs
Diffstat (limited to 'lib/stif')
-rw-r--r--lib/stif/codif_line_id.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/stif/codif_line_id.rb b/lib/stif/codif_line_id.rb
new file mode 100644
index 000000000..b7f3c8bd5
--- /dev/null
+++ b/lib/stif/codif_line_id.rb
@@ -0,0 +1,16 @@
+module STIF
+ module CodifLineId extend self
+
+ LINE_OBJECT_ID_SEPERATOR = ':'
+
+ def extract_codif_line_id line_name
+ line_name.split(LINE_OBJECT_ID_SEPERATOR).last
+ end
+
+ def lines_set_from_functional_scope(functional_scope)
+ Set.new(
+ functional_scope
+ .map{ |line| extract_codif_line_id line })
+ end
+ end
+end