Class: ComfortableMexicanSofa::Seeds::Exporter

Inherits:
Object
  • Object
show all
Defined in:
lib/comfortable_mexican_sofa/seeds.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, to = from) ⇒ Exporter

Returns a new instance of Exporter.



77
78
79
80
81
# File 'lib/comfortable_mexican_sofa/seeds.rb', line 77

def initialize(from, to = from)
  self.from = from
  self.to   = to
  self.site = Comfy::Cms::Site.where(identifier: from).first!
end

Instance Attribute Details

#fromObject

Returns the value of attribute from.



72
73
74
# File 'lib/comfortable_mexican_sofa/seeds.rb', line 72

def from
  @from
end

#pathObject

Returns the value of attribute path.



72
73
74
# File 'lib/comfortable_mexican_sofa/seeds.rb', line 72

def path
  @path
end

#siteObject

Returns the value of attribute site.



72
73
74
# File 'lib/comfortable_mexican_sofa/seeds.rb', line 72

def site
  @site
end

#toObject

Returns the value of attribute to.



72
73
74
# File 'lib/comfortable_mexican_sofa/seeds.rb', line 72

def to
  @to
end

Instance Method Details

#export!(classes = SEED_CLASSES) ⇒ Object



83
84
85
86
87
88
# File 'lib/comfortable_mexican_sofa/seeds.rb', line 83

def export!(classes = SEED_CLASSES)
  classes.each do |klass|
    klass = "ComfortableMexicanSofa::Seeds::#{klass}::Exporter"
    klass.constantize.new(from, to).export!
  end
end