Class: SiteTarget

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::Model

columns, from_csv, from_json, headers, #to_csv, #to_hash, #to_s, view

Constructor Details

#initialize(attributes = {}) ⇒ SiteTarget



12
13
14
15
# File 'lib/domain/site_target/model.rb', line 12

def initialize(attributes = {})
  attributes[:type] = determine_target_type(attributes[:target]) if attributes[:type].nil? && attributes[:target]
  super(attributes)
end

Instance Attribute Details

#includedObject

Returns the value of attribute included.



6
7
8
# File 'lib/domain/site_target/model.rb', line 6

def included
  @included
end

#scopeObject

Returns the value of attribute scope.



6
7
8
# File 'lib/domain/site_target/model.rb', line 6

def scope
  @scope
end

#site_idObject

Returns the value of attribute site_id.



6
7
8
# File 'lib/domain/site_target/model.rb', line 6

def site_id
  @site_id
end

#targetObject

Returns the value of attribute target.



6
7
8
# File 'lib/domain/site_target/model.rb', line 6

def target
  @target
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/domain/site_target/model.rb', line 6

def type
  @type
end

Class Method Details

.primary_keyObject



17
18
19
# File 'lib/domain/site_target/model.rb', line 17

def self.primary_key
  %w[site_id target type included scope]
end

.table_nameObject



21
22
23
# File 'lib/domain/site_target/model.rb', line 21

def self.table_name
  'site_target'
end