Class: Clot::SelectMinute

Inherits:
NumberedTag show all
Defined in:
lib/clot/date_tags.rb

Constant Summary

Constants inherited from ClotTag

ClotTag::Syntax

Instance Method Summary collapse

Methods inherited from NumberedTag

#default_end, #default_start, #get_options, #id_string, #name_string, #render_string, #set_primary_attributes, #value_string

Methods inherited from ClotTag

#initialize, #render

Methods included from TagHelper

#resolve_value, #split_params

Methods included from AttributeSetter

#set_attributes, #set_primary_attributes

Constructor Details

This class inherits a constructor from Clot::ClotTag

Instance Method Details

#can_show(val) ⇒ Object



106
107
108
# File 'lib/clot/date_tags.rb', line 106

def can_show(val)
  @minute_step.nil? || (val % @minute_step) == 0
end

#default_field_nameObject



102
103
104
# File 'lib/clot/date_tags.rb', line 102

def default_field_name
  "minute"
end

#personal_attributes(name, value) ⇒ Object



110
111
112
113
114
115
# File 'lib/clot/date_tags.rb', line 110

def personal_attributes(name,value)
  case name
    when "minute_step" then
      @minute_step = value
  end || super(name, value)
end

#time_methodObject



99
100
101
# File 'lib/clot/date_tags.rb', line 99

def time_method
  :min
end