Class: Ayadn::ChannelObject
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#counts ⇒ Object
readonly
Returns the value of attribute counts.
-
#editors ⇒ Object
readonly
Returns the value of attribute editors.
-
#has_unread ⇒ Object
readonly
Returns the value of attribute has_unread.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#is_inactive ⇒ Object
readonly
Returns the value of attribute is_inactive.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#pagination_id ⇒ Object
readonly
Returns the value of attribute pagination_id.
-
#readers ⇒ Object
readonly
Returns the value of attribute readers.
-
#recent_message ⇒ Object
readonly
Returns the value of attribute recent_message.
-
#recent_message_id ⇒ Object
readonly
Returns the value of attribute recent_message_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#writers ⇒ Object
readonly
Returns the value of attribute writers.
-
#you_can_edit ⇒ Object
readonly
Returns the value of attribute you_can_edit.
-
#you_muted ⇒ Object
readonly
Returns the value of attribute you_muted.
-
#you_subscribed ⇒ Object
readonly
Returns the value of attribute you_subscribed.
Instance Method Summary collapse
-
#initialize(hash) ⇒ ChannelObject
constructor
A new instance of ChannelObject.
Constructor Details
#initialize(hash) ⇒ ChannelObject
Returns a new instance of ChannelObject.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/ayadn/channel_object.rb', line 47 def initialize hash @input = hash @pagination_id = @input["pagination_id"] @is_inactive = @input["is_inactive"] @readers = ChannelReadersObject.new(@input["readers"]) @you_muted = @input["you_muted"] @you_can_edit = @input["you_can_edit"] @has_unread = @input["has_unread"] @editors = ChannelEditorsObject.new(@input["editors"]) @annotations = @input["annotations"].map { |ann| PostAnnotationObject.new(ann) } @recent_message_id = @input["recent_message_id"] @writers = ChannelEditorsObject.new(@input["writers"]) @you_subscribed = @input["you_subscribed"] @owner = @input["owner"].nil? ? nil : UserObject.new(@input["owner"]) @type = @input["type"] @id = @input["id"] @counts = ChannelCountsObject.new(@input["counts"]) @recent_message = @input["recent_message"].nil? ? nil : PostObject.new(@input["recent_message"]) end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def annotations @annotations end |
#counts ⇒ Object (readonly)
Returns the value of attribute counts.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def counts @counts end |
#editors ⇒ Object (readonly)
Returns the value of attribute editors.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def editors @editors end |
#has_unread ⇒ Object (readonly)
Returns the value of attribute has_unread.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def has_unread @has_unread end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def id @id end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def input @input end |
#is_inactive ⇒ Object (readonly)
Returns the value of attribute is_inactive.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def is_inactive @is_inactive end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def owner @owner end |
#pagination_id ⇒ Object (readonly)
Returns the value of attribute pagination_id.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def pagination_id @pagination_id end |
#readers ⇒ Object (readonly)
Returns the value of attribute readers.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def readers @readers end |
#recent_message ⇒ Object (readonly)
Returns the value of attribute recent_message.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def @recent_message end |
#recent_message_id ⇒ Object (readonly)
Returns the value of attribute recent_message_id.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def @recent_message_id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def type @type end |
#writers ⇒ Object (readonly)
Returns the value of attribute writers.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def writers @writers end |
#you_can_edit ⇒ Object (readonly)
Returns the value of attribute you_can_edit.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def you_can_edit @you_can_edit end |
#you_muted ⇒ Object (readonly)
Returns the value of attribute you_muted.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def you_muted @you_muted end |
#you_subscribed ⇒ Object (readonly)
Returns the value of attribute you_subscribed.
45 46 47 |
# File 'lib/ayadn/channel_object.rb', line 45 def you_subscribed @you_subscribed end |