Class: UploadConfiguration
- Inherits:
-
Object
- Object
- UploadConfiguration
- Defined in:
- lib/model/upload_configuration.rb
Instance Attribute Summary collapse
-
#app_id ⇒ Object
Returns the value of attribute app_id.
-
#application_key ⇒ Object
Returns the value of attribute application_key.
-
#company_id ⇒ Object
Returns the value of attribute company_id.
-
#distribution_group ⇒ Object
Returns the value of attribute distribution_group.
-
#publish_email ⇒ Object
Returns the value of attribute publish_email.
-
#service ⇒ Object
Returns the value of attribute service.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#app_id ⇒ Object
Returns the value of attribute app_id.
17 18 19 |
# File 'lib/model/upload_configuration.rb', line 17 def app_id @app_id end |
#application_key ⇒ Object
Returns the value of attribute application_key.
17 18 19 |
# File 'lib/model/upload_configuration.rb', line 17 def application_key @application_key end |
#company_id ⇒ Object
Returns the value of attribute company_id.
17 18 19 |
# File 'lib/model/upload_configuration.rb', line 17 def company_id @company_id end |
#distribution_group ⇒ Object
Returns the value of attribute distribution_group.
17 18 19 |
# File 'lib/model/upload_configuration.rb', line 17 def distribution_group @distribution_group end |
#publish_email ⇒ Object
Returns the value of attribute publish_email.
17 18 19 |
# File 'lib/model/upload_configuration.rb', line 17 def publish_email @publish_email end |
#service ⇒ Object
Returns the value of attribute service.
17 18 19 |
# File 'lib/model/upload_configuration.rb', line 17 def service @service end |
Class Method Details
.load(configuration_name) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/model/upload_configuration.rb', line 44 def load(configuration_name) upload_config = UploadConfiguration.new yaml = YAML.load_file(UPLOAD_CONFIGURATION_YAML_PATH) if yaml.has_key?(YAML_CONFIGURATIONS_KEY) setups = yaml[YAML_CONFIGURATIONS_KEY] parse_named_config setups, upload_config, configuration_name end return upload_config end |
Instance Method Details
#parse_configuration(setup) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/model/upload_configuration.rb', line 19 def parse_configuration(setup) if setup.has_key?(YAML_CONFIG_APPLICATION_KEY_KEY) @application_key = setup[YAML_CONFIG_APPLICATION_KEY_KEY] end if setup.has_key?(YAML_CONFIG_SERVICE_KEY) @service = setup[YAML_CONFIG_SERVICE_KEY] end if setup.has_key?(YAML_CONFIG_COMPANY_ID_KEY) @company_id = setup[YAML_CONFIG_COMPANY_ID_KEY] end if setup.has_key?(YAML_CONFIG_APP_ID_KEY) @app_id = setup[YAML_CONFIG_APP_ID_KEY] end if setup.has_key?(YAML_CONFIG_PUBLISH_EMAIL_KEY) @publish_email = setup[YAML_CONFIG_PUBLISH_EMAIL_KEY] if @publish_email.kind_of?(Array) == false @publish_email = [@publish_email] end end if setup.has_key?(YAML_CONFIG_DISTRIBUTION_GROUP_KEY) @distribution_group = setup[YAML_CONFIG_DISTRIBUTION_GROUP_KEY] end end |