Class: User
- Inherits:
-
Object
- Object
- User
- Includes:
- Templator
- Defined in:
- lib/generators/feature/user.rb
Instance Attribute Summary collapse
-
#generator ⇒ Object
readonly
Returns the value of attribute generator.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #background_steps(action = nil) ⇒ Object
-
#initialize(generator, name) ⇒ User
constructor
A new instance of User.
- #set? ⇒ Boolean
Methods included from Templator
Constructor Details
#initialize(generator, name) ⇒ User
Returns a new instance of User.
7 8 9 10 |
# File 'lib/generators/feature/user.rb', line 7 def initialize(generator, name) @generator = generator @name = name end |
Instance Attribute Details
#generator ⇒ Object (readonly)
Returns the value of attribute generator.
5 6 7 |
# File 'lib/generators/feature/user.rb', line 5 def generator @generator end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/generators/feature/user.rb', line 5 def name @name end |
Instance Method Details
#background_steps(action = nil) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/generators/feature/user.rb', line 12 def background_steps(action = nil) if action == :new render File.join('features', 'users', "background_steps.feature") else render File.join('features', 'users', "background_steps_with_models.feature") end end |
#set? ⇒ Boolean
20 21 22 |
# File 'lib/generators/feature/user.rb', line 20 def set? !@name.nil? end |