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.rb
Size: Mime:
module EventSource
  class Stream
    initializer :name

    def self.get_type(name)
      subtype = name.split(':').last.split('-').first

      if name.start_with?(subtype)
        return :stream
      else
        return subtype.to_sym
      end
    end

    def type
      @type ||= self.class.get_type(name)
    end

    def category
      @category ||= StreamName.get_category(name)
    end

    def category?
      @is_category ||= !name.include?('-')
    end
  end
end