Class: AuthorizedRailsScaffolds::RSpecScaffoldViewHelper

Inherits:
RSpecScaffoldHelper show all
Includes:
Macros::AttributeMacros, Macros::FactoryMacros
Defined in:
lib/authorized_rails_scaffolds/rspec_scaffold_view_helper.rb

Instance Method Summary collapse

Methods included from Macros::FactoryMacros

#create_parent_resource_from_factory, #create_resource_from_factory, #factory_attribute_string, #factory_attribute_value

Methods included from Macros::AttributeMacros

#datetime_attributes, #output_attributes, #references_attributes, #standard_attributes

Methods inherited from RSpecScaffoldHelper

#describe_nesting_comment, #end_nesting_block, #modular_class_name, #parent_variables, #references_show_route, #start_nesting_block, #start_shallow_nesting_block

Methods included from Macros::TestVarMacros

#references_test_name, #references_test_sym, #references_test_var, #resource_test_name, #resource_test_sym, #resource_test_var

Methods inherited from Helper

#plural_var_name, #shallow_routes?, #var_name

Methods included from Macros::ResourceMacros

#resource_array_key, #resource_array_name, #resource_array_sym, #resource_array_var, #resource_class, #resource_directory, #resource_human_name, #resource_key, #resource_name, #resource_symbol, #resource_var

Methods included from Macros::PathMacros

#controller_edit_route, #controller_index_path, #controller_index_route, #controller_new_route, #controller_show_route, #references_show_route

Methods included from Macros::ParentMacros

#model_parent_name, #parent_model_names, #parent_models, #parent_module_groups, #parent_modules, #parent_sym, #parent_variable, #parent_variables

Constructor Details

#initialize(options = {}) ⇒ RSpecScaffoldViewHelper

Returns a new instance of RSpecScaffoldViewHelper.



5
6
7
# File 'lib/authorized_rails_scaffolds/rspec_scaffold_view_helper.rb', line 5

def initialize(options = {})
  super options
end

Instance Method Details

#attributesObject



9
10
11
# File 'lib/authorized_rails_scaffolds/rspec_scaffold_view_helper.rb', line 9

def attributes
  @attributes
end

#date_select_day_value(date_string) ⇒ Object



25
26
27
# File 'lib/authorized_rails_scaffolds/rspec_scaffold_view_helper.rb', line 25

def date_select_day_value(date_string)
  DateTime.parse(date_string).strftime('%-d')
end

#date_select_hour_value(date_string) ⇒ Object



29
30
31
# File 'lib/authorized_rails_scaffolds/rspec_scaffold_view_helper.rb', line 29

def date_select_hour_value(date_string)
  DateTime.parse(date_string).strftime('%H')
end

#date_select_minute_value(date_string) ⇒ Object



33
34
35
# File 'lib/authorized_rails_scaffolds/rspec_scaffold_view_helper.rb', line 33

def date_select_minute_value(date_string)
  DateTime.parse(date_string).strftime('%M')
end

#date_select_month_text(date_string) ⇒ Object



21
22
23
# File 'lib/authorized_rails_scaffolds/rspec_scaffold_view_helper.rb', line 21

def date_select_month_text(date_string)
  DateTime.parse(date_string).strftime('%B')
end

#date_select_month_value(date_string) ⇒ Object



17
18
19
# File 'lib/authorized_rails_scaffolds/rspec_scaffold_view_helper.rb', line 17

def date_select_month_value(date_string)
  DateTime.parse(date_string).strftime('%-m')
end

#date_select_year_value(date_string) ⇒ Object



13
14
15
# File 'lib/authorized_rails_scaffolds/rspec_scaffold_view_helper.rb', line 13

def date_select_year_value(date_string)
  DateTime.parse(date_string).strftime('%Y')
end