Class: Playbook::PbTime::Time

Inherits:
Object
  • Object
show all
Includes:
Playbook::Props
Defined in:
app/pb_kits/playbook/pb_time/time.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



23
24
25
26
27
28
29
30
# File 'app/pb_kits/playbook/pb_time/time.rb', line 23

def classname
  # convert deprecated prop values
  mutated_size = size
  mutated_size = "sm" if mutated_size == "xs"
  mutated_size = "md" if mutated_size == "lg"

  generate_classname("pb_time_kit", align, mutated_size)
end

#format_time_stringObject



32
33
34
# File 'app/pb_kits/playbook/pb_time/time.rb', line 32

def format_time_string
  "#{pb_date_time.to_hour}:#{pb_date_time.to_minutes}#{pb_date_time.to_meridian}"
end

#format_timezone_stringObject



36
37
38
# File 'app/pb_kits/playbook/pb_time/time.rb', line 36

def format_timezone_string
  pb_date_time.to_timezone.to_s
end

#pb_date_timeObject



40
41
42
# File 'app/pb_kits/playbook/pb_time/time.rb', line 40

def pb_date_time
  Playbook::PbKit::PbDateTime.new(time, timezone)
end