Sha256: 7d8fa09397895367713def1b0ee07f83f55f0249357d48d0af3ef140a312144d

Contents?: true

Size: 1.95 KB

Versions: 633

Compression:

Stored size: 1.95 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 :new_window, type: Playbook::Props::Boolean,
                        default: false
      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 city_emphasis_props
        {
          address_house_style: address_house_style,
          address_house_style2: address_house_style2,
          city_state: city_state,
          dark: dark,
          home_id: home_id,
          home_url: home_url,
          new_window: new_window,
          territory: territory,
          zip: zip,
        }
      end

      def street_emphasis_props
        {
          address_house_style: address_house_style,
          address_house_style2: address_house_style2,
          city_state_zip: city_state_zip,
          dark: dark,
          home_id: home_id,
          home_url: home_url,
          new_window: new_window,
          territory: territory,
        }
      end

    private

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

Version data entries

633 entries across 633 versions & 1 rubygems

Version Path
playbook_ui-14.3.0.pre.rc.8 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.3.0.pre.rc.7 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.3.0.pre.rc.6 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.3.0.pre.rc.5 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.3.0.pre.rc.4 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.2.1.pre.alpha.20240828cikubedbump3702 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.3.0.pre.rc.3 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.2.1.pre.alpha.PBNTR431fixingduplicatingtextareaclassname3689 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.3.0.pre.rc.2 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.2.1.pre.alpha.PLAY1516railsiconsfixedwidth3674 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.2.1.pre.alpha.PBNTR479removeextraspacingfromradiochildren3671 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.3.0.pre.rc.1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.2.1.pre.alpha.PBNTR479removeextraspacingfromradiochildren3669 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.2.1.pre.alpha.pbntr373enablekitsforradio3665 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.2.1.pre.alpha.bugfixforactionrc3663 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.2.0.pre.alpha.PLAY15063653 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.2.0.pre.alpha.play1490railsdialogdatafix3649 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.2.0.pre.alpha.PLAY15063645 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.2.1 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb
playbook_ui-14.2.0.pre.alpha.PLAY15063640 app/pb_kits/playbook/pb_home_address_street/home_address_street.rb