Sha256: c3d574f3b981e7a5c3844adb72dd9f8328fd794395a2482cef480c90cb78a002
Contents?: true
Size: 1.73 KB
Versions: 3
Compression:
Stored size: 1.73 KB
Contents
module Playbook module PbOwnerPhone class OwnerPhone < Playbook::PbKit::Base PROPS = [:configured_classname, :configured_data, :configured_id, :configured_first_name, :configured_last_name, :configured_number, :configured_icon].freeze def initialize(classname: default_configuration, data: default_configuration, id: default_configuration, first_name: default_configuration, last_name: default_configuration, number: default_configuration, icon: default_configuration) self.configured_classname = classname self.configured_data = data self.configured_id = id self.configured_first_name = first_name self.configured_last_name = last_name self.configured_number = number self.configured_icon = icon end def icon if is_set? configured_icon configured_icon end end def phone phone = Playbook::PbPhone::Phone.new({ icon: configured_icon, number: configured_number }) ApplicationController.renderer.render(partial: phone, as: :object) end def name owner = Playbook::PbOwner::Owner.new({ first_name: configured_first_name, last_name: configured_last_name }) ApplicationController.renderer.render(partial: owner, as: :object) end def number if is_set? configured_number configured_number end end def to_partial_path "pb_owner_phone/owner_phone" end private DEFAULT = Object.new private_constant :DEFAULT def default_configuration DEFAULT end attr_accessor(*PROPS) end end end
Version data entries
3 entries across 3 versions & 1 rubygems