Class: Faker::Science

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/default/science.rb

Constant Summary

Constants inherited from Base

Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters

Class Method Summary collapse

Methods inherited from Base

bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale

Class Method Details

.elementString

Produces the name of a element.

Examples:

Faker::Science.element #=> "Carbon"

Returns:

  • (String)

Available since:

  • 1.8.5


15
16
17
# File 'lib/faker/default/science.rb', line 15

def element
  fetch('science.element')
end

.element_stateString

Produces the state of an element.

Examples:

Faker::Science.element_state #=> "Liquid"

Returns:

  • (String)

Available since:

  • next


41
42
43
# File 'lib/faker/default/science.rb', line 41

def element_state
  fetch('science.element_state')
end

.element_subcategoryString

Produces the subcategory of an element.

Examples:

Faker::Science.element_subcategory #=> "Reactive nonmetal"

Returns:

  • (String)

Available since:

  • next


54
55
56
# File 'lib/faker/default/science.rb', line 54

def element_subcategory
  fetch('science.element_subcategory')
end

.element_symbolString

Produces the symbol of an element.

Examples:

Faker::Science.element_symbol #=> "Pb"

Returns:

  • (String)

Available since:

  • 1.9.0


28
29
30
# File 'lib/faker/default/science.rb', line 28

def element_symbol
  fetch('science.element_symbol')
end

.scientistString

Produces the name of a scientist.

Examples:

Faker::Science.scientist #=> "Isaac Newton"

Returns:

  • (String)

Available since:

  • 1.8.5


67
68
69
# File 'lib/faker/default/science.rb', line 67

def scientist
  fetch('science.scientist')
end