Class: Clot::SelectYear

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

Instance Method Summary collapse

Methods inherited from NumberedTag

#can_show, #get_options, #id_string, #name_string, #render_string, #set_primary_attributes, #time_method, #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

#default_endObject



198
199
200
# File 'lib/clot/date_tags.rb', line 198

def default_end
  @end_year || @value_string + 5
end

#default_field_nameObject



190
191
192
# File 'lib/clot/date_tags.rb', line 190

def default_field_name
  "year"
end

#default_startObject



194
195
196
# File 'lib/clot/date_tags.rb', line 194

def default_start
  @start_year || @value_string - 5
end

#personal_attributes(name, value) ⇒ Object



202
203
204
205
206
207
208
209
# File 'lib/clot/date_tags.rb', line 202

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