Sha256: 1c9c8d2d71c7a9d4a27dd43e9efea8ebb251e38aca624e896484775281b13dc5

Contents?: true

Size: 610 Bytes

Versions: 4

Compression:

Stored size: 610 Bytes

Contents

module RubyHackernews

  class ConfigurationService

    def self.base_url=(url)
      @base_url = url
    end

    def self.base_url
      return @base_url || "http://news.ycombinator.com/"
    end

    def self.new_url
      return File.join(self.base_url, "newest")
    end

    def self.ask_url
      return File.join(self.base_url, "ask")
    end

    def self.jobs_url
      return File.join(self.base_url, "jobs")
    end

    def self.comments_url
      return File.join(self.base_url, "newcomments")
    end

    def self.submit_url
      return File.join(self.base_url, "submit")
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-hackernews-1.3.3 lib/ruby-hackernews/services/configuration_service.rb
ruby-hackernews-1.3.2 lib/ruby-hackernews/services/configuration_service.rb
ruby-hackernews-1.3.1 lib/ruby-hackernews/services/configuration_service.rb
ruby-hackernews-1.3.0 lib/ruby-hackernews/services/configuration_service.rb