Class: Linksta::Checker
- Inherits:
-
Object
- Object
- Linksta::Checker
- Defined in:
- lib/linksta.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
- #base ⇒ Object
- #concurrency ⇒ Object
-
#initialize(config) ⇒ Checker
constructor
A new instance of Checker.
- #smoke ⇒ Object
- #status_code ⇒ Object
Constructor Details
#initialize(config) ⇒ Checker
Returns a new instance of Checker.
55 56 57 |
# File 'lib/linksta.rb', line 55 def initialize(config) @config = YAML.load(File.open("#{config}")) end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
53 54 55 |
# File 'lib/linksta.rb', line 53 def config @config end |
Instance Method Details
#base ⇒ Object
59 60 61 |
# File 'lib/linksta.rb', line 59 def base config["base"] end |
#concurrency ⇒ Object
63 64 65 |
# File 'lib/linksta.rb', line 63 def concurrency config["concurrency"] ? config["concurrency"] : 100 end |
#smoke ⇒ Object
71 72 73 74 75 76 |
# File 'lib/linksta.rb', line 71 def smoke urls = config["paths"] = config["headers"] headers = Hash[*] Getter.new(urls, base, concurrency, status_code, { :headers => headers }).check end |
#status_code ⇒ Object
67 68 69 |
# File 'lib/linksta.rb', line 67 def status_code config["status_code"] ? config["status_code"] : 200 end |