Class: MicrosoftProductLifecycle

Inherits:
Domain::Model show all
Defined in:
lib/domain/software/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_urlObject

Returns the value of attribute docs_url.



49
50
51
# File 'lib/domain/software/model.rb', line 49

def docs_url
  @docs_url
end

#editionObject

Returns the value of attribute edition.



49
50
51
# File 'lib/domain/software/model.rb', line 49

def edition
  @edition
end

#extended_end_dateObject

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

#idObject

Returns the value of attribute id.



49
50
51
# File 'lib/domain/software/model.rb', line 49

def id
  @id
end

#main_stream_dateObject

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

#productObject

Returns the value of attribute product.



49
50
51
# File 'lib/domain/software/model.rb', line 49

def product
  @product
end

#releaseObject

Returns the value of attribute release.



49
50
51
# File 'lib/domain/software/model.rb', line 49

def release
  @release
end

#release_end_dateObject

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_dateObject

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_dateObject

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_dateObject

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_policyObject

Returns the value of attribute support_policy.



49
50
51
# File 'lib/domain/software/model.rb', line 49

def support_policy
  @support_policy
end