Class: Playbook::PbTimeStacked::TimeStacked

Inherits:
Object
  • Object
show all
Includes:
ActionView::Context, ActionView::Helpers::TagHelper, Playbook::Props
Defined in:
app/pb_kits/playbook/pb_time_stacked/time_stacked.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



22
23
24
# File 'app/pb_kits/playbook/pb_time_stacked/time_stacked.rb', line 22

def classname
  generate_classname("pb_time_stacked_kit", dark_class, classnames)
end

#dayObject



26
27
28
29
30
31
# File 'app/pb_kits/playbook/pb_time_stacked/time_stacked.rb', line 26

def day
  day = Playbook::PbKit::PbDateTime.new(date)
  (:time, datetime: day.to_iso) do
    day.to_day.to_s
  end
end

#format_time_stringObject



40
41
42
# File 'app/pb_kits/playbook/pb_time_stacked/time_stacked.rb', line 40

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

#format_timezoneObject



44
45
46
# File 'app/pb_kits/playbook/pb_time_stacked/time_stacked.rb', line 44

def format_timezone
  pb_date_time.to_timezone
end

#monthObject



33
34
35
36
37
38
# File 'app/pb_kits/playbook/pb_time_stacked/time_stacked.rb', line 33

def month
  month = Playbook::PbKit::PbDateTime.new(date)
  (:time, datetime: month.to_iso) do
    month.to_month.to_s
  end
end

#tag_classnamesObject



48
49
50
# File 'app/pb_kits/playbook/pb_time_stacked/time_stacked.rb', line 48

def tag_classnames
  "pb_time_stacked_kit_#{tag}"
end