Class: Adva::Static::Import
- Inherits:
-
Object
- Object
- Adva::Static::Import
- Defined in:
- lib/adva/static/import.rb,
lib/adva/static/import/model.rb,
lib/adva/static/import/format.rb,
lib/adva/static/import/source.rb,
lib/adva/static/import/request.rb,
lib/adva/static/import/model/base.rb,
lib/adva/static/import/model/blog.rb,
lib/adva/static/import/model/page.rb,
lib/adva/static/import/model/post.rb,
lib/adva/static/import/model/site.rb,
lib/adva/static/import/model/section.rb
Defined Under Namespace
Modules: Format, Model Classes: Request, Source
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #import(path) ⇒ Object
-
#initialize(options = {}) ⇒ Import
constructor
A new instance of Import.
- #request_for(path) ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Import
Returns a new instance of Import.
11 12 13 |
# File 'lib/adva/static/import.rb', line 11 def initialize( = {}) @root = Pathname.new(File.([:source] || 'import')) end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
9 10 11 |
# File 'lib/adva/static/import.rb', line 9 def root @root end |
Instance Method Details
#import(path) ⇒ Object
21 22 23 24 |
# File 'lib/adva/static/import.rb', line 21 def import(path) model = recognize(path).first model.updated_record.save! if model end |