Faker v0.12.0 Faker.Commerce View Source
Functions for generating commerce related data
Link to this section Summary
Functions
Returns a random color
Returns a random department
Returns a random number that represents a price
Returns a complete product name, based on product adjectives, product materials, product names
Returns a random adjective for a product
Returns a random product material
Returns a random product name
Link to this section Functions
Link to this function
color()
View Source
color()
View Source
color() :: String.t()
color() :: String.t()
Returns a random color
Examples
iex> Faker.Commerce.color()
"red"
iex> Faker.Commerce.color()
"sky blue"
iex> Faker.Commerce.color()
"lavender"
iex> Faker.Commerce.color()
"grey"
Link to this function
department()
View Source
department()
View Source
department() :: String.t()
department() :: String.t()
Returns a random department
Examples
iex> Faker.Commerce.department()
"Home, Garden & Tools"
iex> Faker.Commerce.department()
"Electronics & Computers"
iex> Faker.Commerce.department()
"Clothing, Shoes & Jewelery"
iex> Faker.Commerce.department()
"Toys, Kids & Baby"
Link to this function
price()
View Source
price()
View Source
price() :: float()
price() :: float()
Returns a random number that represents a price
Examples
iex> Faker.Commerce.price()
1.11
iex> Faker.Commerce.price()
4.02
iex> Faker.Commerce.price()
8.36
iex> Faker.Commerce.price()
3.05
Link to this function
product_name()
View Source
product_name()
View Source
product_name() :: String.t()
product_name() :: String.t()
Returns a complete product name, based on product adjectives, product materials, product names
Examples
iex> Faker.Commerce.product_name()
"Ergonomic Steel Shirt"
iex> Faker.Commerce.product_name()
"Fantastic Car"
iex> Faker.Commerce.product_name()
"Granite Gloves"
iex> Faker.Commerce.product_name()
"Plastic Shoes"
Link to this function
product_name_adjective()
View Source
product_name_adjective()
View Source
product_name_adjective() :: String.t()
product_name_adjective() :: String.t()
Returns a random adjective for a product
Examples
iex> Faker.Commerce.product_name_adjective()
"Small"
iex> Faker.Commerce.product_name_adjective()
"Ergonomic"
iex> Faker.Commerce.product_name_adjective()
"Incredible"
iex> Faker.Commerce.product_name_adjective()
"Gorgeous"
Link to this function
product_name_material()
View Source
product_name_material()
View Source
product_name_material() :: String.t()
product_name_material() :: String.t()
Returns a random product material
Examples
iex> Faker.Commerce.product_name_material()
"Rubber"
iex> Faker.Commerce.product_name_material()
"Concrete"
iex> Faker.Commerce.product_name_material()
"Steel"
iex> Faker.Commerce.product_name_material()
"Granite"
Link to this function
product_name_product()
View Source
product_name_product()
View Source
product_name_product() :: String.t()
product_name_product() :: String.t()
Returns a random product name
Examples
iex> Faker.Commerce.product_name_product()
"Gloves"
iex> Faker.Commerce.product_name_product()
"Computer"
iex> Faker.Commerce.product_name_product()
"Table"
iex> Faker.Commerce.product_name_product()
"Shirt"