Sha256: 89742d05c5350f500a35b5b29f2298044f903427992bc836e8cacc2302014ab5

Contents?: true

Size: 366 Bytes

Versions: 38

Compression:

Stored size: 366 Bytes

Contents

# frozen_string_literal: true

require './spec/support/models/default_valueable'

class Server
  extend DefaultValueable

  attr_writer :host, :port

  default_reader :host, value: 'server.com', accept_nil: false
  default_reader :port, value: 80,           accept_nil: true

  def url
    return "http://#{host}" unless port

    "http://#{host}:#{port}"
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
sinclair-2.1.1 spec/support/models/server.rb
sinclair-2.1.0 spec/support/models/server.rb
sinclair-2.0.1 spec/support/models/server.rb
sinclair-2.0.0 spec/support/models/server.rb
sinclair-1.16.3 spec/support/models/server.rb
sinclair-1.16.2 spec/support/models/server.rb
sinclair-1.16.1 spec/support/models/server.rb
sinclair-1.16.0 spec/support/models/server.rb
sinclair-1.15.0 spec/support/models/server.rb
sinclair-1.14.2 spec/support/models/server.rb
sinclair-1.14.1 spec/support/models/server.rb
sinclair-1.14.0 spec/support/models/server.rb
sinclair-1.13.0 spec/support/models/server.rb
sinclair-1.12.1 spec/support/models/server.rb
sinclair-1.12.0 spec/support/models/server.rb
sinclair-1.11.0 spec/support/models/server.rb
sinclair-1.10.0 spec/support/models/server.rb
sinclair-1.9.0 spec/support/models/server.rb
sinclair-1.8.0 spec/support/models/server.rb
sinclair-1.7.0 spec/support/models/server.rb