diff options
| author | Robert | 2017-11-27 10:07:30 +0100 |
|---|---|---|
| committer | Robert | 2017-12-14 15:34:46 +0100 |
| commit | 695d6604f12515507e2e8d435370d30df5fc820d (patch) | |
| tree | afbb8919268ea2a5cd96b232d64eb7dbc108de34 /lib/stif/codif_line_id.rb | |
| parent | 1eacdd594ec0079372c7e8d0c32d283e2a20a05c (diff) | |
| download | chouette-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/codif_line_id.rb')
| -rw-r--r-- | lib/stif/codif_line_id.rb | 16 |
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 |
