Class: LogfileMock
- Inherits:
-
Object
- Object
- LogfileMock
- Defined in:
- lib/ip-world-map/logfile_mock.rb
Instance Attribute Summary collapse
-
#max_random_positions ⇒ Object
Returns the value of attribute max_random_positions.
-
#min_random_positions ⇒ Object
Returns the value of attribute min_random_positions.
Instance Method Summary collapse
-
#initialize ⇒ LogfileMock
constructor
A new instance of LogfileMock.
- #positions ⇒ Object
- #random_longitude_latitude ⇒ Object
Constructor Details
#initialize ⇒ LogfileMock
Returns a new instance of LogfileMock.
4 5 6 7 |
# File 'lib/ip-world-map/logfile_mock.rb', line 4 def initialize @min_random_positions = 5 @max_random_positions = 50 end |
Instance Attribute Details
#max_random_positions ⇒ Object
Returns the value of attribute max_random_positions.
2 3 4 |
# File 'lib/ip-world-map/logfile_mock.rb', line 2 def max_random_positions @max_random_positions end |
#min_random_positions ⇒ Object
Returns the value of attribute min_random_positions.
2 3 4 |
# File 'lib/ip-world-map/logfile_mock.rb', line 2 def min_random_positions @min_random_positions end |
Instance Method Details
#positions ⇒ Object
13 14 15 16 |
# File 'lib/ip-world-map/logfile_mock.rb', line 13 def positions amount = @min_random_positions + rand(@max_random_positions - @min_random_positions + 1) Array.new(amount){ random_longitude_latitude } end |
#random_longitude_latitude ⇒ Object
9 10 11 |
# File 'lib/ip-world-map/logfile_mock.rb', line 9 def random_longitude_latitude [ -10 + rand(25) + rand, 40 + rand(15) + rand ] end |