Class: FiverrCopy::Recipe

Inherits:
Object
  • Object
show all
Defined in:
lib/fiverr_copy/recipe.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil, description = "A FiverrCopy Recipe") {|_self| ... } ⇒ Recipe

Returns a new instance of Recipe.

Yields:

  • (_self)

Yield Parameters:



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/fiverr_copy/recipe.rb', line 14

def initialize(name = nil, description = "A FiverrCopy Recipe", &block)
  raise "Please specifiy a name for a Recipe" if name.nil?
  self.name = name
  self.description = description
  self.port = 1234
  self.chunk_size = 1024
  self.manual = false
  self.gem_installation_auth = ""
  @initialized_clients = []
  yield(self)
  self
end

Instance Attribute Details

#chunk_sizeObject

Returns the value of attribute chunk_size.



2
3
4
# File 'lib/fiverr_copy/recipe.rb', line 2

def chunk_size
  @chunk_size
end

#clientsObject

Returns the value of attribute clients.



2
3
4
# File 'lib/fiverr_copy/recipe.rb', line 2

def clients
  @clients
end

#descriptionObject

Returns the value of attribute description.



2
3
4
# File 'lib/fiverr_copy/recipe.rb', line 2

def description
  @description
end

#filterObject

Returns the value of attribute filter.



2
3
4
# File 'lib/fiverr_copy/recipe.rb', line 2

def filter
  @filter
end

#gem_installation_authObject

Returns the value of attribute gem_installation_auth.



2
3
4
# File 'lib/fiverr_copy/recipe.rb', line 2

def gem_installation_auth
  @gem_installation_auth
end

#initialized_clientsObject (readonly)

Returns the value of attribute initialized_clients.



12
13
14
# File 'lib/fiverr_copy/recipe.rb', line 12

def initialized_clients
  @initialized_clients
end

#manualObject

Returns the value of attribute manual.



2
3
4
# File 'lib/fiverr_copy/recipe.rb', line 2

def manual
  @manual
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/fiverr_copy/recipe.rb', line 2

def name
  @name
end

#portObject

Returns the value of attribute port.



2
3
4
# File 'lib/fiverr_copy/recipe.rb', line 2

def port
  @port
end

#usernameObject

Returns the value of attribute username.



2
3
4
# File 'lib/fiverr_copy/recipe.rb', line 2

def username
  @username
end

Instance Method Details

#infoObject



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/fiverr_copy/recipe.rb', line 44

def info
  puts "Recipe: #{self.name}"
  puts "---------------------"
  puts self.description
  puts
  puts "Filter  : #{self.filter}"
  puts "Clients : #{self.initialized_clients.size}"
  puts "Port    : #{self.port}"
  puts "Chunk   : #{self.chunk_size}"
  puts "Manual  : #{self.manual_client_activation?}"
  puts "---------------------"
end

#manual_client_activation?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/fiverr_copy/recipe.rb', line 27

def manual_client_activation?
  self.manual == true
end