Class: Lifestream::Branch
- Inherits:
-
Object
- Object
- Lifestream::Branch
- Defined in:
- lib/lifestream/branch.rb
Defined Under Namespace
Classes: InvalidBranch
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#published_at ⇒ Object
Returns the value of attribute published_at.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(channel, published_at, title, body = nil) ⇒ Branch
constructor
A new instance of Branch.
- #inspect ⇒ Object
Constructor Details
#initialize(channel, published_at, title, body = nil) ⇒ Branch
Returns a new instance of Branch.
6 7 8 9 10 11 |
# File 'lib/lifestream/branch.rb', line 6 def initialize channel, published_at, title, body = nil @channel, @published_at, @title, @body = channel, published_at, title, body unless @channel.kind_of?(Lifestream::Channel) raise Lifestream::Branch::InvalidBranch.new('@channel is not a kind if Lifestream::Channel') end end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
4 5 6 |
# File 'lib/lifestream/branch.rb', line 4 def body @body end |
#channel ⇒ Object
Returns the value of attribute channel.
4 5 6 |
# File 'lib/lifestream/branch.rb', line 4 def channel @channel end |
#published_at ⇒ Object
Returns the value of attribute published_at.
4 5 6 |
# File 'lib/lifestream/branch.rb', line 4 def published_at @published_at end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/lifestream/branch.rb', line 4 def title @title end |
Instance Method Details
#inspect ⇒ Object
13 14 15 |
# File 'lib/lifestream/branch.rb', line 13 def inspect "#<Lifestream::Branch @published_at=#{@published_at} @title=#{@title} @body=#{@body} @channel=#{!!@channel}>" end |