Class: Chuck::Joke
- Inherits:
-
Object
- Object
- Chuck::Joke
- Defined in:
- lib/chuck/joke.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#categories ⇒ Object
Returns the value of attribute categories.
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Joke
constructor
A new instance of Joke.
- #to_s ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Joke
Returns a new instance of Joke.
5 6 7 |
# File 'lib/chuck/joke.rb', line 5 def initialize( = {}) .each{|k, v| self.send("#{k}=", v) if respond_to?(k) } end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/chuck/joke.rb', line 3 def body @body end |
#categories ⇒ Object
Returns the value of attribute categories.
3 4 5 |
# File 'lib/chuck/joke.rb', line 3 def categories @categories end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/chuck/joke.rb', line 3 def id @id end |
Class Method Details
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'lib/chuck/joke.rb', line 15 def to_s @body end |