Sha256: 85da590b9b499bb5e54c300a313662103ead18ceaac7202f012b14b5c4d286da

Contents?: true

Size: 1.22 KB

Versions: 36

Compression:

Stored size: 1.22 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbHomeAddressStreet
    class HomeAddressStreet
      include Playbook::Props

      partial "pb_home_address_street/home_address_street"

      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.titleize}, #{state} #{zipcode}"
      end

      def city_state
        "#{city.titleize}, #{state}"
      end

      def zip
        zipcode.to_s
      end

      def address_house_style
        "#{address&.titleize} #{separator} #{house_style}"
      end

      def address_house_style2
        address_cont&.titleize
      end

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

    private

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

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
playbook_ui-7.14.0.pre.alpha1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.16.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.15.1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.15.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.14.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.13.0.pre.alpha1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.13.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.12.1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.12.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.11.1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.11.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.11.0.pre.alpha1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.10.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.9.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.8.4 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.8.3 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.8.2 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.8.1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.8.0 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-7.7.0.pre.alpha1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb