Class: Three::Generators::BrowserExample

Inherits:
Object
  • Object
show all
Defined in:
lib/three/generators/browser_example.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target:, root: Dir.pwd, force: false, stream: $stdout) ⇒ BrowserExample

Returns a new instance of BrowserExample.



13
14
15
16
17
18
19
20
# File 'lib/three/generators/browser_example.rb', line 13

def initialize(target:, root: Dir.pwd, force: false, stream: $stdout)
  @root = File.expand_path(root)
  @target = File.expand_path(target, @root)
  @force = force
  @stream = stream
  @created = []
  @skipped = []
end

Instance Attribute Details

#createdObject (readonly)

Returns the value of attribute created.



11
12
13
# File 'lib/three/generators/browser_example.rb', line 11

def created
  @created
end

#skippedObject (readonly)

Returns the value of attribute skipped.



11
12
13
# File 'lib/three/generators/browser_example.rb', line 11

def skipped
  @skipped
end

Instance Method Details

#callObject



22
23
24
25
26
27
28
29
# File 'lib/three/generators/browser_example.rb', line 22

def call
  validate_target!
  validate_example_files!
  copy_runtime
  write_example_files
  report
  self
end