Class: Selfiegram

Inherits:
Object show all
Defined in:
lib/selfiegram.rb,
lib/runner/runner.rb,
lib/runner/options/options.rb

Defined Under Namespace

Classes: Runner

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Selfiegram

Returns a new instance of Selfiegram.



29
30
31
32
# File 'lib/selfiegram.rb', line 29

def initialize(options={})
  options.each { |key, value| send("#{key}=", value) }
  puts options if verbose
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



16
17
18
# File 'lib/selfiegram.rb', line 16

def action
  @action
end

#background_image_pathObject

Returns the value of attribute background_image_path.



16
17
18
# File 'lib/selfiegram.rb', line 16

def background_image_path
  @background_image_path
end

#imageObject

Returns the value of attribute image.



16
17
18
# File 'lib/selfiegram.rb', line 16

def image
  @image
end

#magicObject

Returns the value of attribute magic.



16
17
18
# File 'lib/selfiegram.rb', line 16

def magic
  @magic
end

#output_pathObject

Returns the value of attribute output_path.



16
17
18
# File 'lib/selfiegram.rb', line 16

def output_path
  @output_path
end

#selfiegram_pathObject

Returns the value of attribute selfiegram_path.



16
17
18
# File 'lib/selfiegram.rb', line 16

def selfiegram_path
  @selfiegram_path
end

#userObject

Returns the value of attribute user.



16
17
18
# File 'lib/selfiegram.rb', line 16

def user
  @user
end

#verboseObject

Returns the value of attribute verbose.



16
17
18
# File 'lib/selfiegram.rb', line 16

def verbose
  @verbose
end

Class Method Details

.add_user(options = {}) ⇒ Object



24
25
26
# File 'lib/selfiegram.rb', line 24

def add_user(options={})
  new(options).add_user
end

.snap(options = {}) ⇒ Object



20
21
22
# File 'lib/selfiegram.rb', line 20

def snap(options={})
  new(options).snap
end

Instance Method Details

#add_userObject



41
42
43
44
# File 'lib/selfiegram.rb', line 41

def add_user
  mkdir(selfiegram_dir)
  cp(image, selfiegram_path)
end

#snapObject



34
35
36
37
38
39
# File 'lib/selfiegram.rb', line 34

def snap
  mkdir(background_image_dir)
  download_background_image
  overlay_selfie
  save
end