Class: Preseason::Config::Factory

Inherits:
Object
  • Object
show all
Includes:
Preseason::Config
Defined in:
lib/preseason/config/factory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Preseason::Colorize

#ask, #readme, #yes?

Methods included from GeneratorContext

#method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Preseason::GeneratorContext

Instance Attribute Details

#libraryObject

Returns the value of attribute library.



6
7
8
# File 'lib/preseason/config/factory.rb', line 6

def library
  @library
end

Instance Method Details

#ask_userObject



8
9
10
11
12
# File 'lib/preseason/config/factory.rb', line 8

def ask_user
  if yes? "Will you be using Factory Girl? [y/n]"
    self.library = :factory_girl
  end
end

#factory_girl?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/preseason/config/factory.rb', line 14

def factory_girl?
  library == :factory_girl
end