Class: Faker::Buront::Saying
- Inherits:
-
Object
- Object
- Faker::Buront::Saying
- Defined in:
- lib/faker/buront/saying.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #body_array ⇒ Object
-
#initialize(title: arg_title, body: arg_body) ⇒ Saying
constructor
A new instance of Saying.
- #oneline ⇒ Object
- #random_body_oneline ⇒ Object
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
#body ⇒ Object
Returns the value of attribute body.
4 5 6 |
# File 'lib/faker/buront/saying.rb', line 4 def body @body end |
#title ⇒ Object
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_array ⇒ Object
11 12 13 |
# File 'lib/faker/buront/saying.rb', line 11 def body_array body.split("\n") end |
#oneline ⇒ Object
15 16 17 |
# File 'lib/faker/buront/saying.rb', line 15 def oneline body_array.join end |
#random_body_oneline ⇒ Object
19 20 21 |
# File 'lib/faker/buront/saying.rb', line 19 def random_body_oneline body_array.sample end |