Class: Moby::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/Moby/Configuration.rb

Constant Summary collapse

AVAILABLE_USER_AGENTS =
(Mechanize::AGENT_ALIASES.keys - ['Mechanize']).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#backendObject

Returns the value of attribute backend.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def backend
  @backend
end

#browserObject

Returns the value of attribute browser.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def browser
  @browser
end

#debugObject

Returns the value of attribute debug.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def debug
  @debug
end

#delayObject

Returns the value of attribute delay.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def delay
  @delay
end

#form_nameObject

Returns the value of attribute form_name.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def form_name
  @form_name
end

#form_numberObject

Returns the value of attribute form_number.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def form_number
  @form_number
end

#iterationsObject

Returns the value of attribute iterations.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def iterations
  @iterations
end

#password_field_nameObject

Returns the value of attribute password_field_name.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def password_field_name
  @password_field_name
end

#password_field_numberObject

Returns the value of attribute password_field_number.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def password_field_number
  @password_field_number
end

#urlObject

Returns the value of attribute url.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def url
  @url
end

#username_field_nameObject

Returns the value of attribute username_field_name.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def username_field_name
  @username_field_name
end

#username_field_numberObject

Returns the value of attribute username_field_number.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def username_field_number
  @username_field_number
end

#username_hostnameObject

Returns the value of attribute username_hostname.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def username_hostname
  @username_hostname
end

#username_is_email_addressObject

Returns the value of attribute username_is_email_address.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def username_is_email_address
  @username_is_email_address
end

#username_prefilledObject

Returns the value of attribute username_prefilled.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def username_prefilled
  @username_prefilled
end

#verboseObject

Returns the value of attribute verbose.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def verbose
  @verbose
end

#word_list_pathObject

Returns the value of attribute word_list_path.



10
11
12
# File 'lib/Moby/Configuration.rb', line 10

def word_list_path
  @word_list_path
end

Instance Method Details

#debug?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/Moby/Configuration.rb', line 66

def debug?
  @debug
end

#fixed_number_of_submissions?Boolean

Returns:

  • (Boolean)


74
75
76
# File 'lib/Moby/Configuration.rb', line 74

def fixed_number_of_submissions?
  !!@iterations
end

#mechanize?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/Moby/Configuration.rb', line 50

def mechanize?
  @backend == :mechanize
end

#selenium?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/Moby/Configuration.rb', line 54

def selenium?
  @backend == :selenium
end

#user_agentObject



34
35
36
# File 'lib/Moby/Configuration.rb', line 34

def user_agent
  @user_agent || random_user_agent
end

#username_is_email_address?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/Moby/Configuration.rb', line 58

def username_is_email_address?
  @username_is_email_address || @username_hostname || @username_field_name == 'email'
end

#username_prefilled?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/Moby/Configuration.rb', line 62

def username_prefilled?
  @username_prefilled
end

#using_form_name?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/Moby/Configuration.rb', line 38

def using_form_name?
  !@form_name.nil?
end

#using_password_field_name?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/Moby/Configuration.rb', line 46

def using_password_field_name?
  !@password_field_name.nil?
end

#using_username_field_name?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/Moby/Configuration.rb', line 42

def using_username_field_name?
  !@username_field_name.nil?
end

#verbose?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/Moby/Configuration.rb', line 70

def verbose?
  @verbose
end