Class: CmdbSite

Inherits:
Object
  • Object
show all
Defined in:
lib/domain/site/model.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, country_code:, business_unit:, sub_area:, application:, utr:) ⇒ CmdbSite

Returns a new instance of CmdbSite.



75
76
77
78
79
80
81
82
# File 'lib/domain/site/model.rb', line 75

def initialize(name:, country_code:, business_unit:, sub_area:, application:, utr:)
  @name = name
  @country_code = country_code
  @business_unit = business_unit
  @sub_area = sub_area
  @application = application
  @utr = utr
end

Instance Attribute Details

#applicationObject

Returns the value of attribute application.



73
74
75
# File 'lib/domain/site/model.rb', line 73

def application
  @application
end

#business_unitObject

Returns the value of attribute business_unit.



73
74
75
# File 'lib/domain/site/model.rb', line 73

def business_unit
  @business_unit
end

#country_codeObject

Returns the value of attribute country_code.



73
74
75
# File 'lib/domain/site/model.rb', line 73

def country_code
  @country_code
end

#nameObject

Returns the value of attribute name.



73
74
75
# File 'lib/domain/site/model.rb', line 73

def name
  @name
end

#sub_areaObject

Returns the value of attribute sub_area.



73
74
75
# File 'lib/domain/site/model.rb', line 73

def sub_area
  @sub_area
end

#utrObject

Returns the value of attribute utr.



73
74
75
# File 'lib/domain/site/model.rb', line 73

def utr
  @utr
end

Class Method Details

.from_csv(row) ⇒ Object



84
85
86
87
88
89
90
91
92
93
# File 'lib/domain/site/model.rb', line 84

def self.from_csv(row)
  CmdbSite.new(
    name: row[:site],
    country_code: row[:country_code],
    business_unit: row[:business_unit],
    sub_area: row[:sub_area],
    application: row[:application],
    utr: row[:utr]
  )
end

Instance Method Details

#to_sObject



95
96
97
# File 'lib/domain/site/model.rb', line 95

def to_s
  [name, country_code, business_unit, sub_area, application, utr].join ','
end