Class: RecurringTodosController::RecurringTodoCreateParamsHelper
- Inherits:
-
Object
- Object
- RecurringTodosController::RecurringTodoCreateParamsHelper
- Defined in:
- app/controllers/recurring_todos_controller.rb
Instance Method Summary (collapse)
- - (Object) attributes
- - (Object) context_name
- - (Boolean) context_specified_by_name?
-
- (RecurringTodoCreateParamsHelper) initialize(params)
constructor
A new instance of RecurringTodoCreateParamsHelper.
- - (Object) project_name
- - (Boolean) project_specified_by_name?
- - (Object) selector_attributes
- - (Object) tag_list
Constructor Details
- (RecurringTodoCreateParamsHelper) initialize(params)
A new instance of RecurringTodoCreateParamsHelper
210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'app/controllers/recurring_todos_controller.rb', line 210 def initialize(params) @params = params['request'] || params @attributes = params['request'] && params['request']['recurring_todo'] || params['recurring_todo'] # make sure all selectors (recurring_period, recurrence_selector, # daily_selector, monthly_selector and yearly_selector) are first in hash # so that they are processed first by the model @selector_attributes = { 'recurring_period' => @attributes['recurring_period'], 'daily_selector' => @attributes['daily_selector'], 'monthly_selector' => @attributes['monthly_selector'], 'yearly_selector' => @attributes['yearly_selector'] } end |
Instance Method Details
- (Object) attributes
225 226 227 |
# File 'app/controllers/recurring_todos_controller.rb', line 225 def attributes @attributes end |
- (Object) context_name
237 238 239 |
# File 'app/controllers/recurring_todos_controller.rb', line 237 def context_name @params['context_name'].strip unless @params['context_name'].nil? end |
- (Boolean) context_specified_by_name?
252 253 254 255 256 |
# File 'app/controllers/recurring_todos_controller.rb', line 252 def context_specified_by_name? return false unless @attributes['context_id'].blank? return false if context_name.blank? true end |
- (Object) project_name
233 234 235 |
# File 'app/controllers/recurring_todos_controller.rb', line 233 def project_name @params['project_name'].strip unless @params['project_name'].nil? end |
- (Boolean) project_specified_by_name?
245 246 247 248 249 250 |
# File 'app/controllers/recurring_todos_controller.rb', line 245 def project_specified_by_name? return false unless @attributes['project_id'].blank? return false if project_name.blank? return false if project_name == 'None' true end |
- (Object) selector_attributes
229 230 231 |
# File 'app/controllers/recurring_todos_controller.rb', line 229 def selector_attributes return @selector_attributes end |
- (Object) tag_list
241 242 243 |
# File 'app/controllers/recurring_todos_controller.rb', line 241 def tag_list @params['tag_list'] end |