Class: Playbook::PbTitleCount::TitleCount

Inherits:
Object
  • Object
show all
Includes:
Playbook::Props
Defined in:
app/pb_kits/playbook/pb_title_count/title_count.rb

Instance Method Summary collapse

Methods included from Playbook::Props

#dark_props, #generate_classname, #generate_classname_without_spacing, #initialize, #prop, #spacing_options, #spacing_props, #spacing_values

Instance Method Details

#classnameObject



19
20
21
# File 'app/pb_kits/playbook/pb_title_count/title_count.rb', line 19

def classname
  generate_classname("pb_title_count_kit", align, size)
end

#format_countObject



27
28
29
# File 'app/pb_kits/playbook/pb_title_count/title_count.rb', line 27

def format_count
  count.to_s.gsub(/(\d)(?=\d{3}+(?:\.|$))(\d{3}\..*)?/, '\1,\2')
end

#title_sizeObject



23
24
25
# File 'app/pb_kits/playbook/pb_title_count/title_count.rb', line 23

def title_size
  size == "lg" ? 3 : 4
end