Class: Playbook::PbTime::Time
- Inherits:
-
Playbook::PbKit::Base
show all
- Includes:
- ActionView::Context, ActionView::Helpers::TagHelper
- Defined in:
- app/pb_kits/playbook/pb_time/time.rb
Constant Summary
collapse
- PROPS =
%i[configured_classname
configured_data
configured_id
configured_size
configured_time
configured_timestamp
configured_timezone].freeze
Instance Method Summary
collapse
#adjusted_value, #aria, #classname, #concat_value, #data, #default_value, #false_value, #id, #is_boolean?, #is_integer?, #is_set?, #is_string?, #is_true?, #merge_value, #one_of?, #one_of_value, #true_value
Constructor Details
#initialize(classname: default_configuration, data: default_configuration, id: default_configuration, size: default_configuration, time: default_configuration, timestamp: default_configuration, timezone: default_configuration) ⇒ Time
Returns a new instance of Time.
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'app/pb_kits/playbook/pb_time/time.rb', line 17
def initialize(classname: default_configuration,
data: default_configuration,
id: default_configuration,
size: default_configuration,
time: default_configuration,
timestamp: default_configuration,
timezone: default_configuration)
self.configured_classname = classname
self.configured_data = data
self.configured_id = id
self.configured_size = size
self.configured_time = time
self.configured_timestamp = timestamp
self.configured_timezone = timezone
end
|
Instance Method Details
#display_value ⇒ Object
33
34
35
36
37
38
39
40
41
42
|
# File 'app/pb_kits/playbook/pb_time/time.rb', line 33
def display_value
case size
when "lg"
display_value_lg
when "sm"
display_value_sm
else
display_value_xs
end
end
|
#kit_class ⇒ Object
44
45
46
47
48
49
50
|
# File 'app/pb_kits/playbook/pb_time/time.rb', line 44
def kit_class
kit_options = [
"pb_time_kit",
size,
]
kit_options.join("_")
end
|
#to_partial_path ⇒ Object
52
53
54
|
# File 'app/pb_kits/playbook/pb_time/time.rb', line 52
def to_partial_path
"pb_time/time"
end
|