Class: UserClassGenerator
- Includes:
- Singleton
- Defined in:
- lib/generators/user_class_generator.rb
Overview
Class used to generate code for a default go-picasa-go user model.
Class Method Summary collapse
Instance Method Summary collapse
-
#generate(file_name, picasa_id, password) ⇒ Object
Generates the file representing the user class.
Class Method Details
.generate(file_name, picasa_id, password) ⇒ Object
17 18 19 |
# File 'lib/generators/user_class_generator.rb', line 17 def self.generate file_name, picasa_id, password UserClassGenerator.instance.generate file_name, picasa_id, password end |
Instance Method Details
#generate(file_name, picasa_id, password) ⇒ Object
Generates the file representing the user class. Needs the name of the file, the picasa_id and password to authenticate and generate the authentication token
10 11 12 13 14 15 |
# File 'lib/generators/user_class_generator.rb', line 10 def generate file_name, picasa_id, password file_name = underscore file_name class_name = camelize file_name auth_token = Picasa::Authentication.authenticate picasa_id, password create_file file_name, class_name, picasa_id, auth_token end |