Class: Arena::Channel
- Includes:
- Connectable, Creatable
- Defined in:
- lib/arena/channel.rb
Instance Attribute Summary collapse
-
#collaboration ⇒ Object
readonly
Returns the value of attribute collaboration.
-
#current_page ⇒ Object
readonly
Returns the value of attribute current_page.
-
#follower_count ⇒ Object
readonly
Returns the value of attribute follower_count.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#open ⇒ Object
readonly
Returns the value of attribute open.
-
#per ⇒ Object
readonly
Returns the value of attribute per.
-
#published ⇒ Object
readonly
Returns the value of attribute published.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#total_pages ⇒ Object
readonly
Returns the value of attribute total_pages.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Attributes inherited from Base
Instance Method Summary collapse
- #_base_class ⇒ Object
- #_class ⇒ Object
- #blocks ⇒ Object
- #collaborators ⇒ Object
- #connection_count ⇒ Object
- #contents ⇒ Object
- #contents_updated_at ⇒ Object
- #contributors ⇒ Object
- #flat_connections ⇒ Object
Methods included from Connectable
#connected_at, #connected_by, #connected_by_different_user?, #connections, #is_block?, #user
Methods included from Creatable
Methods inherited from Base
Constructor Details
This class inherits a constructor from Arena::Base
Instance Attribute Details
#collaboration ⇒ Object (readonly)
Returns the value of attribute collaboration.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def collaboration @collaboration end |
#current_page ⇒ Object (readonly)
Returns the value of attribute current_page.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def current_page @current_page end |
#follower_count ⇒ Object (readonly)
Returns the value of attribute follower_count.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def follower_count @follower_count end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def id @id end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def kind @kind end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def length @length end |
#open ⇒ Object (readonly)
Returns the value of attribute open.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def open @open end |
#per ⇒ Object (readonly)
Returns the value of attribute per.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def per @per end |
#published ⇒ Object (readonly)
Returns the value of attribute published.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def published @published end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def slug @slug end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def status @status end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def title @title end |
#total_pages ⇒ Object (readonly)
Returns the value of attribute total_pages.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def total_pages @total_pages end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
12 13 14 |
# File 'lib/arena/channel.rb', line 12 def user_id @user_id end |
Instance Method Details
#_base_class ⇒ Object
20 21 22 |
# File 'lib/arena/channel.rb', line 20 def _base_class @attrs['base_class'] end |
#_class ⇒ Object
16 17 18 |
# File 'lib/arena/channel.rb', line 16 def _class @attrs['class'] end |
#blocks ⇒ Object
54 55 56 |
# File 'lib/arena/channel.rb', line 54 def blocks contents.select { |connectable| connectable._base_class == "Block" } end |
#collaborators ⇒ Object
36 37 38 |
# File 'lib/arena/channel.rb', line 36 def collaborators @collaborators ||= @attrs['collaborators'].collect { |user| Arena::User.new(user) } end |
#connection_count ⇒ Object
32 33 34 |
# File 'lib/arena/channel.rb', line 32 def connection_count @connection_count ||= contents.collect(&:connections).flatten.size end |
#contents ⇒ Object
24 25 26 |
# File 'lib/arena/channel.rb', line 24 def contents @contents ||= @attrs['contents'].collect { |object| "Arena::#{object['class']}".constantize.new(object) } end |
#contents_updated_at ⇒ Object
28 29 30 |
# File 'lib/arena/channel.rb', line 28 def contents_updated_at # todo end |
#contributors ⇒ Object
40 41 42 |
# File 'lib/arena/channel.rb', line 40 def contributors @contributors ||= contents.collect(&:user).uniq(&:id) end |
#flat_connections ⇒ Object
44 45 46 |
# File 'lib/arena/channel.rb', line 44 def flat_connections @flat_connections ||= contents.collect(&:connections).flatten.compact.uniq(&:id) end |