Class: Faker::Buront::Saying

Inherits:
Object
  • Object
show all
Defined in:
lib/faker/buront/saying.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title: arg_title, body: arg_body) ⇒ Saying

Returns a new instance of Saying.



6
7
8
9
# File 'lib/faker/buront/saying.rb', line 6

def initialize(title: arg_title,body: arg_body)
  self.title = title
  self.body = body
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



4
5
6
# File 'lib/faker/buront/saying.rb', line 4

def body
  @body
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/faker/buront/saying.rb', line 4

def title
  @title
end

Instance Method Details

#body_arrayObject



11
12
13
# File 'lib/faker/buront/saying.rb', line 11

def body_array
  body.split("\n")
end

#onelineObject



15
16
17
# File 'lib/faker/buront/saying.rb', line 15

def oneline
  body_array.join
end

#random_body_onelineObject



19
20
21
# File 'lib/faker/buront/saying.rb', line 19

def random_body_oneline
  body_array.sample
end