Class: Journea::Step

Inherits:
Object
  • Object
show all
Includes:
SimpleFormObject
Defined in:
lib/journea/step.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SimpleFormObject

#_delegation_target, #attribute?, #attributes, #column_for_attribute, #delegatable?, #initialize, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class SimpleFormObject

Class Attribute Details

.custom_nameObject

Returns the value of attribute custom_name.



11
12
13
# File 'lib/journea/step.rb', line 11

def custom_name
  @custom_name
end

Instance Attribute Details

#journeyObject

Returns the value of attribute journey.



5
6
7
# File 'lib/journea/step.rb', line 5

def journey
  @journey
end

Class Method Details

.permitted_paramsObject



14
15
16
# File 'lib/journea/step.rb', line 14

def self.permitted_params
  attributes.map(&:name)
end

.step_nameObject



18
19
20
# File 'lib/journea/step.rb', line 18

def self.step_name
  custom_name.presence || model_name.to_s.underscore
end

Instance Method Details

#persisted?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/journea/step.rb', line 28

def persisted?
  true
end

#pre_save(form_params) ⇒ Object



26
# File 'lib/journea/step.rb', line 26

def pre_save(form_params) end

#step_nameObject



22
23
24
# File 'lib/journea/step.rb', line 22

def step_name
  self.class.step_name
end