File: dog.rb

package info (click to toggle)
ruby-faker 3.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,360 kB
  • sloc: ruby: 20,654; makefile: 6; sh: 6
file content (115 lines) | stat: -rw-r--r-- 2,430 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# frozen_string_literal: true

module Faker
  class Creature
    class Dog < Base
      flexible :dog

      class << self
        ##
        # Produces a random name for a dog
        #
        # @return [String]
        #
        # @example
        #   Faker::Creature::Dog.name #=> "Spike"
        #
        # @faker.version 1.9.2
        def name
          fetch('creature.dog.name')
        end

        ##
        # Produces a random dog breed
        #
        # @return [String]
        #
        # @example
        #   Faker::Creature::Dog.breed #=> "Yorkshire Terrier"
        #
        # @faker.version 1.9.2
        def breed
          fetch('creature.dog.breed')
        end

        ##
        # Produces a random sound made by a dog
        #
        # @return [String]
        #
        # @example
        #   Faker::Creature::Dog.sound #=> "woof woof"
        #
        # @faker.version 1.9.2
        def sound
          fetch('creature.dog.sound')
        end

        ##
        # Produces a random dog meme phrase
        #
        # @return [String]
        #
        # @example
        #   Faker::Creature::Dog.meme_phrase #=> "smol pupperino"
        #
        # @faker.version 1.9.2
        def meme_phrase
          fetch('creature.dog.meme_phrase')
        end

        ##
        # Produces a random dog age
        #
        # @return [String]
        #
        # @example
        #   Faker::Creature::Dog.age #=> "puppy"
        #
        # @faker.version 1.9.2
        def age
          fetch('creature.dog.age')
        end

        ##
        # Produces a random gender
        #
        # @return [String]
        #
        # @example
        #   Faker::Creature::Dog.gender #=> "Female"
        #
        # @faker.version 1.9.2
        def gender
          Faker::Gender.binary_type
        end

        ##
        # Produces a random coat length
        #
        # @return [String]
        #
        # @example
        #   Faker::Creature::Dog.coat_length #=> "short"
        #
        # @faker.version 1.9.2
        def coat_length
          fetch('creature.dog.coat_length')
        end

        ##
        # Produces a random size of a dog
        #
        # @return [String]
        #
        # @example
        #   Faker::Creature::Dog.size #=> "small"
        #
        # @faker.version 1.9.2
        def size
          fetch('creature.dog.size')
        end
      end
    end
  end
end