Sha256: a410d6ab54067a3f05549dcb3a3bc1c1381533aa501ba1075698382cefd3b02d

Contents?: true

Size: 984 Bytes

Versions: 1

Compression:

Stored size: 984 Bytes

Contents

# frozen_string_literal: true

module ExtraSpace
  # e.g. https://www.extraspace.com/storage/facilities/us/alabama/auburn/3264/
  class Rates
    # @attribute [rw] nsc
    #   @return [Integer]
    attr_accessor :nsc

    # @attribute [rw] street
    #   @return [Integer]
    attr_accessor :street

    # @attribute [rw] web
    #   @return [Integer]
    attr_accessor :web

    # @param nsc [Integer]
    # @param street [Integer]
    # @param web [Integer]
    def initialize(nsc:, street:, web:)
      @nsc = nsc
      @street = street
      @web = web
    end

    # @return [String]
    def inspect
      props = [
        "nsc=#{@nsc.inspect}",
        "street=#{@street.inspect}",
        "web=#{@web.inspect}"
      ]
      "#<#{self.class.name} #{props.join(' ')}>"
    end

    # @param data [Hash]
    #
    # @return [Rates]
    def self.parse(data:)
      new(
        nsc: data['nsc'],
        street: data['street'],
        web: data['web']
      )
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
extraspace-0.1.1 lib/extraspace/rates.rb