Class: GoImport::Settings
- Inherits:
-
Object
- Object
- GoImport::Settings
show all
- Includes:
- SerializeHelper
- Defined in:
- lib/go_import/model/settings.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#get_import_rows, #serialize, #serialize_to_file
Constructor Details
#initialize(opt = nil) ⇒ Settings
44
45
46
47
48
49
50
51
|
# File 'lib/go_import/model/settings.rb', line 44
def initialize(opt = nil)
if opt != nil
serialize_variables.each do |myattr|
val = opt[myattr[:id]]
instance_variable_set("@" + myattr[:id].to_s, val) if val != nil
end
end
end
|
Instance Attribute Details
#deal ⇒ Object
Returns the value of attribute deal.
5
6
7
|
# File 'lib/go_import/model/settings.rb', line 5
def deal
@deal
end
|
#organization ⇒ Object
Returns the value of attribute organization.
5
6
7
|
# File 'lib/go_import/model/settings.rb', line 5
def organization
@organization
end
|
#person ⇒ Object
Returns the value of attribute person.
5
6
7
|
# File 'lib/go_import/model/settings.rb', line 5
def person
@person
end
|
Instance Method Details
#serialize_name ⇒ Object
57
58
59
|
# File 'lib/go_import/model/settings.rb', line 57
def serialize_name
"Settings"
end
|
#serialize_variables ⇒ Object
53
54
55
|
# File 'lib/go_import/model/settings.rb', line 53
def serialize_variables
[:organization, :person, :deal].map {|p| {:id => p, :type => :class_settings} }
end
|
#with_deal {|@deal| ... } ⇒ Object
39
40
41
42
|
# File 'lib/go_import/model/settings.rb', line 39
def with_deal
@deal = DealClassSettings.new if @deal ==nil
yield @deal
end
|
#with_organization {|@organization| ... } ⇒ Object
15
16
17
18
|
# File 'lib/go_import/model/settings.rb', line 15
def with_organization
@organization = ClassSettings.new if @organization ==nil
yield @organization
end
|
#with_person {|@person| ... } ⇒ Object
27
28
29
30
|
# File 'lib/go_import/model/settings.rb', line 27
def with_person
@person = ClassSettings.new if @person ==nil
yield @person
end
|