Sha256: cc86fbcc1f73c5dae1ebc975d5f9d3ddebdbf8c43a25c183a8e088d747d1fb0a

Contents?: true

Size: 1.27 KB

Versions: 48

Compression:

Stored size: 1.27 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbHomeAddressStreet
    class HomeAddressStreet < Playbook::KitBase
      prop :address
      prop :address_cont
      prop :city
      prop :emphasis, type: Playbook::Props::Enum,
                      values: %w[street city],
                      default: "street"
      prop :home_id, type: Playbook::Props::Number
      prop :home_url
      prop :house_style
      prop :state
      prop :zipcode
      prop :territory
      prop :dark, type: Playbook::Props::Boolean, default: false

      def classname
        generate_classname("pb_home_address_street_kit", dark_class)
      end

      def city_state_zip
        [city_state, zipcode].join(" ")
      end

      def city_state
        [city&.titleize, state].join(", ")
      end

      def zip
        zipcode.to_s
      end

      def address_house_style
        [address&.titleize, house_style].join(separator)
      end

      def address_house_style2
        address_cont&.titleize
      end

      def separator
        house_style ? " \u00b7 " : ""
      end

      def emphasis_partial
        File.join(File.dirname(self.class.source_location), "_#{emphasis}_emphasis")
      end

    private

      def dark_class
        dark ? "dark" : nil
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
playbook_ui-10.23.0.pre.alpha2 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.23.0.pre.cachetest app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.23.0.pre.alpha1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.22.1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.22.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.21.1.pre.alpha1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.21.0.pre.alpha.lightbox.2 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.21.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.21.0.pre.alpha.lightbox app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.21.0.pre.alpha.rg1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.21.0.pre.alpha.jg1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.21.0.pre.alpha.na1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.21.0.pre.alpha.jd1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.20.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.19.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.19.0.pre.lightbox app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.18.2 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.19.0.pre.popover.alpha1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.18.1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-10.18.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb