Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
event_source / lib / event_source / stream_name.rb
Size: Mime:
module EventSource
  module StreamName
    extend self

    def stream_name(category_name, id=nil)
      id ||= Identifier::UUID.random

      "#{category_name}-#{id}"
    end

    def category_stream_name(category_name)
      category_name
    end

    def self.get_id(stream_name)
      Identifier::UUID.parse(stream_name)
    end

    def self.category(stream_name)
      stream_name.split('-').first
    end
  end
end