Class: MicrosoftProductLifecycle
- Inherits:
-
Domain::Model
- Object
- Domain::Model
- MicrosoftProductLifecycle
- Defined in:
- lib/domain/software/model.rb
Instance Attribute Summary collapse
-
#docs_url ⇒ Object
Returns the value of attribute docs_url.
-
#edition ⇒ Object
Returns the value of attribute edition.
-
#extended_end_date ⇒ Object
Returns the value of attribute extended_end_date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#main_stream_date ⇒ Object
Returns the value of attribute main_stream_date.
-
#product ⇒ Object
Returns the value of attribute product.
-
#release ⇒ Object
Returns the value of attribute release.
-
#release_end_date ⇒ Object
Returns the value of attribute release_end_date.
-
#release_start_date ⇒ Object
Returns the value of attribute release_start_date.
-
#retirement_date ⇒ Object
Returns the value of attribute retirement_date.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#support_policy ⇒ Object
Returns the value of attribute support_policy.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ MicrosoftProductLifecycle
constructor
A new instance of MicrosoftProductLifecycle.
Methods inherited from Domain::Model
columns, from_csv, from_json, headers, primary_key, table_name, #to_csv, #to_hash, #to_s, view
Constructor Details
#initialize(attributes = {}) ⇒ MicrosoftProductLifecycle
Returns a new instance of MicrosoftProductLifecycle.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/domain/software/model.rb', line 62 def initialize(attributes = {}) remapped_attributes = attributes.transform_keys do |key| case key when 'Product' then 'product' when 'Edition' then 'edition' when 'Release' then 'release' when 'SupportPolicy' then 'support_policy' when 'StartDate' then 'start_date' when 'MainStreamDate' then 'main_stream_date' when 'ExtendedEndDate' then 'extended_end_date' when 'RetirementDate' then 'retirement_date' when 'ReleaseStartDate' then 'release_start_date' when 'ReleaseEndDate' then 'release_end_date' when 'DocsUrl' then 'docs_url' else key end end product = remapped_attributes['product'] edition = remapped_attributes['edition'] release = remapped_attributes['release'] remapped_attributes['id'] = [product, edition, release] .compact .select { |attr| attr.strip.length > 0 } .join(':') super(remapped_attributes) end |
Instance Attribute Details
#docs_url ⇒ Object
Returns the value of attribute docs_url.
49 50 51 |
# File 'lib/domain/software/model.rb', line 49 def docs_url @docs_url end |
#edition ⇒ Object
Returns the value of attribute edition.
49 50 51 |
# File 'lib/domain/software/model.rb', line 49 def edition @edition end |
#extended_end_date ⇒ Object
Returns the value of attribute extended_end_date.
49 50 51 |
# File 'lib/domain/software/model.rb', line 49 def extended_end_date @extended_end_date end |
#id ⇒ Object
Returns the value of attribute id.
49 50 51 |
# File 'lib/domain/software/model.rb', line 49 def id @id end |
#main_stream_date ⇒ Object
Returns the value of attribute main_stream_date.
49 50 51 |
# File 'lib/domain/software/model.rb', line 49 def main_stream_date @main_stream_date end |
#product ⇒ Object
Returns the value of attribute product.
49 50 51 |
# File 'lib/domain/software/model.rb', line 49 def product @product end |
#release ⇒ Object
Returns the value of attribute release.
49 50 51 |
# File 'lib/domain/software/model.rb', line 49 def release @release end |
#release_end_date ⇒ Object
Returns the value of attribute release_end_date.
49 50 51 |
# File 'lib/domain/software/model.rb', line 49 def release_end_date @release_end_date end |
#release_start_date ⇒ Object
Returns the value of attribute release_start_date.
49 50 51 |
# File 'lib/domain/software/model.rb', line 49 def release_start_date @release_start_date end |
#retirement_date ⇒ Object
Returns the value of attribute retirement_date.
49 50 51 |
# File 'lib/domain/software/model.rb', line 49 def retirement_date @retirement_date end |
#start_date ⇒ Object
Returns the value of attribute start_date.
49 50 51 |
# File 'lib/domain/software/model.rb', line 49 def start_date @start_date end |
#support_policy ⇒ Object
Returns the value of attribute support_policy.
49 50 51 |
# File 'lib/domain/software/model.rb', line 49 def support_policy @support_policy end |