Module: Vishnu::StandardTime::RailsHelpers
- Defined in:
- lib/vishnu/standard_time/rails_helpers.rb
Instance Method Summary collapse
- #vst_badge(parts = Vishnu::StandardTime.local_now) ⇒ Object
- #vst_clock(parts = Vishnu::StandardTime.local_now) ⇒ Object
- #vst_flows_left(parts = Vishnu::StandardTime.local_now) ⇒ Object
Instance Method Details
#vst_badge(parts = Vishnu::StandardTime.local_now) ⇒ Object
14 15 16 17 |
# File 'lib/vishnu/standard_time/rails_helpers.rb', line 14 def vst_badge(parts = Vishnu::StandardTime.local_now) html = %(<a class="vst-badge" href="#{CGI.escapeHTML(Vishnu::StandardTime.website_url)}" target="_blank" rel="noopener">#{CGI.escapeHTML(Vishnu::StandardTime.format_prompt(parts))}</a>) html.respond_to?(:html_safe) ? html.html_safe : html end |
#vst_clock(parts = Vishnu::StandardTime.local_now) ⇒ Object
9 10 11 12 |
# File 'lib/vishnu/standard_time/rails_helpers.rb', line 9 def vst_clock(parts = Vishnu::StandardTime.local_now) html = %(<span class="vst-clock" data-vst-url="#{CGI.escapeHTML(Vishnu::StandardTime.website_url)}">#{CGI.escapeHTML(Vishnu::StandardTime.format_vst(parts))}</span>) html.respond_to?(:html_safe) ? html.html_safe : html end |
#vst_flows_left(parts = Vishnu::StandardTime.local_now) ⇒ Object
19 20 21 |
# File 'lib/vishnu/standard_time/rails_helpers.rb', line 19 def vst_flows_left(parts = Vishnu::StandardTime.local_now) CGI.escapeHTML(Vishnu::StandardTime.format_flows_left(parts)) end |