Class: Stratagem::Snapshot

Inherits:
Object show all
Defined in:
lib/stratagem/snapshot.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



3
4
5
# File 'lib/stratagem/snapshot.rb', line 3

def model
  @model
end

#project_nameObject (readonly)

Returns the value of attribute project_name.



3
4
5
# File 'lib/stratagem/snapshot.rb', line 3

def project_name
  @project_name
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



3
4
5
# File 'lib/stratagem/snapshot.rb', line 3

def timestamp
  @timestamp
end

Class Method Details

.create(project_name) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/stratagem/snapshot.rb', line 5

def self.create(project_name)
  # Build the meta-model
  logger.phase('modeling_application')
  model = Stratagem::ModelBuilder.new.run

  # Crawl site 
  logger.phase('traversing_site')
  model.crawler = Stratagem::SiteCrawler.new(model).run

  # Return the snapshot
  self.new(project_name, Time.now, model)
end

.loggerObject



18
19
20
# File 'lib/stratagem/snapshot.rb', line 18

def self.logger
  Stratagem.logger
end