Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2091 faker drones #2096

Merged
merged 3 commits into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
- [Faker::Dessert](doc/default/dessert.md)
- [Faker::Device](doc/default/device.md)
- [Faker::DrivingLicence](doc/default/driving_licence.md)
- [Faker::Drone](doc/drone/drone.md)
- [Faker::Educator](doc/default/educator.md)
- [Faker::ElectricalComponents](doc/default/electrical_components.md)
- [Faker::Esport](doc/default/esport.md)
Expand Down
34 changes: 34 additions & 0 deletions doc/drone/drone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# `Faker::Drone`

```ruby
# Aircraft Properties
Faker::Drone.name #=> "DJI Mavic Air 2"
Faker::Drone.weight #=> "570g"
Faker::Drone.max_ascent_speed #=> "4m/s"
Faker::Drone.max_descent_speed #=> "3m/s"
Faker::Drone.flight_time #=> "34Mins"
Faker::Drone.max_altitude #=> "5000m"
Faker::Drone.max_flight_distance #=> "18500m"
Faker::Drone.max_speed #=> "19m/s"
Faker::Drone.max_wind_resistance #=> "10.5m/s"
Faker::Drone.max_angular_velocity #=> "250º/s"
Faker::Drone.max_tilt_angle #=> "35º"
Faker::Drone.operating_temprature #=> "14º-104ºF"

# Battery Properties
Faker::Drone.battery_capacity #=> "3500 mAh"
Faker::Drone.battery_voltage #=> "13.2V"
Faker::Drone.battery_type #=> "LiPo 4S"
Faker::Drone.battery_weight #=> "198g"
Faker::Drone.charging_temprature #=> "41º-104ºF"
Faker::Drone.max_charging_power #=> "38W"

# Camera Properties
Faker::Drone.iso #=> "100-3200"
Faker::Drone.max_resolution #=> "48MP
Faker::Drone.photo_format #=> "JPEG"
Faker::Drone.video_format #=> "MP4"
Faker::Drone.shutter_speed_range #=> "8-1/8000s"
Faker::Drone.max_shutter_speed #=> "60"
Faker::Drone.min_shutter_speed #=> "1/8000"
```
332 changes: 332 additions & 0 deletions lib/faker/default/drone.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,332 @@
# frozen_string_literal: true

module Faker
class Drone < Base
class << self
##
# Returns random drone name with company
#
# @return [string]
#
# @example
# Faker::Drone.name #=> "DJI Mavic Air 2"
#
# @faker.version next
def name
fetch('drone.name')
end

##
# Returns total drone weight in grams
#
# @return [String]
#
# @example
# Faker::Drone.weight #=> "570g"
#
# @faker.version next
def weight
parse('drone.weight')
end

##
# Returns maximum ascent speed for drone in m/s
#
# @return [String]
#
# @example
# Faker::Drone.max_ascent_speed #=> "4m/s"
#
# @faker.version next
def max_ascent_speed
parse('drone.max_ascent_speed')
end

##
# Returns maximum descent speed for drone in m/s
#
# @return [String]
#
# @example
# Faker::Drone.max_descent_speed #=> "4m/s"
#
# @faker.version next
def max_descent_speed
parse('drone.max_descent_speed')
end

##
# Returns max flight time for drone in optimal conditions
#
# @return [String]
#
# @example
# Faker::Drone.flight_time #=> "34Mins"
#
# @faker.version next
def flight_time
parse('drone.flight_time')
end

##
# Returns max altitude drone can go above sea level in meters
#
# @return [String]
#
# @example
# Faker::Drone.max_altitude #=> "5000m"
#
# @faker.version next
def max_altitude
parse('drone.max_altitude')
end

##
# Returns how far drone can go in optimal condition when full charged in meters
#
# @return [String]
#
# @example
# Faker::Drone.max_flight_distance #=> "18500m"
#
# @faker.version next
def max_flight_distance
parse('drone.max_flight_distance')
end

##
# Returns max horizontal speed by drone in m/s
#
# @return [String]
#
# @example
# Faker::Drone.max_speed #=> "19m/s"
#
# @faker.version next
def max_speed
parse('drone.max_speed')
end

##
# Returns max wind resistance by drone in m/s
#
# @return [String]
#
# @example
# Faker::Drone.max_wind_resistance #=> "10.5m/s"
#
# @faker.version next
def max_wind_resistance
parse('drone.max_wind_resistance')
end

##
# Returns max angular velocity of drone in degrees/s
#
# @return [String]
#
# @example
# Faker::Drone.max_angular_velocity #=> "250 degree/s"
#
# @faker.version next
def max_angular_velocity
parse('drone.max_angular_velocity')
end

##
# Returns max tilt angle drone can go in degrees
#
# @return [String]
#
# @example
# Faker::Drone.max_tilt_angle #=> "35 degrees"
#
# @faker.version next
def max_tilt_angle
parse('drone.max_tilt_angle')
end

##
# Returns operating temprature for drone in Fahrenheit
#
# @return [String]
#
# @example
# Faker::Drone.operating_temperature #=> "14-104F"
#
# @faker.version next
def operating_temperature
parse('drone.operating_temperature')
end

##
# Returns the drone battery capacity
#
# @return [String]
#
# @example
# Faker::Drone.battery_capacity #=> "3500mAh"
#
# @faker.version next
def battery_capacity
parse('drone.battery_capacity')
end

##
# Returns battery voltage
#
# @return [String]
#
# @example
# Faker::Drone.battery_voltage #=> "13.2V"
#
# @faker.version next
def battery_voltage
parse('drone.battery_voltage')
end

##
# Returns the battery type
#
# @return [String]
#
# @example
# Faker::Drone.battery_type #=> "LiPo 4S"
#
# @faker.version next
def battery_type
parse('drone.battery_type')
end

##
# Returns total battery weight in grams
#
# @return [String]
#
# @example
# Faker::Drone.battery_weight #=> "198g"
#
# @faker.version next
def battery_weight
parse('drone.battery_weight')
end

##
# Returns charging temperature for battery in Fahrenheit
#
# @return [String]
#
# @example
# Faker::Drone.charging_temperature #=> "41-104F"
#
# @faker.version next
def charging_temperature
parse('drone.charging_temperature')
end

##
# Returns max chargin power required for battery
#
# @return [String]
#
# @example
# Faker::Drone.max_charging_power #=> "38W"
#
# @faker.version next
def max_charging_power
parse('drone.max_charging_power')
end

##
# Returns camera ISO range for drone
#
# @return [String]
#
# @example
# Faker::Drone.iso #=> "100-3200"
#
# @faker.version next
def iso
parse('drone.iso')
end

##
# Returns max camera resolution in MP"
#
# @return [String]
#
# @example
# Faker::Drone.max_resolution #=> "48MP"
#
# @faker.version next
def max_resolution
parse('drone.max_resolution')
end

##
# Returns photo format for drone
#
# @return [String]
#
# @example
# Faker::Drone.photo_format #=> "JPEG"
#
# @faker.version next
def photo_format
parse('drone.photo_format')
end

##
# Returns video format
#
# @return [String]
#
# @example
# Faker::Drone.video_format #=> "MP4"
#
# @faker.version next
def video_format
parse('drone.video_format')
end

##
# Returns max and min shutter speed for camera
#
# @return [String]
#
# @example
# Faker::Drone.shutter_speed_range #=> "8-1/8000s"
#
# @faker.version next
def shutter_speed_range
"#{fetch('drone.max_shutter_speed')}-#{fetch('drone.min_shutter_speed')}s"
sudeeptarlekar marked this conversation as resolved.
Show resolved Hide resolved
end

##
# Returns max shutter speed for camera
#
# @return [String]
#
# @example
# Faker::Drone.max_shutter_speed #=> "60s"
#
# @faker.version next
def max_shutter_speed
"#{fetch('drone.max_shutter_speed')}s"
sudeeptarlekar marked this conversation as resolved.
Show resolved Hide resolved
end

##
# Returns min shutter speed for camera
#
# @return [String]
#
# @example
# Faker::Drone.min_shutter_speed #=> "1/8000s"
#
# @faker.version next
def min_shutter_speed
"#{fetch('drone.min_shutter_speed')}s"
sudeeptarlekar marked this conversation as resolved.
Show resolved Hide resolved
end
end
end
end
Loading