class Ayadn::ChannelObject
Attributes
annotations[R]
counts[R]
editors[R]
has_unread[R]
id[R]
input[R]
is_inactive[R]
owner[R]
pagination_id[R]
readers[R]
recent_message[R]
recent_message_id[R]
type[R]
writers[R]
you_can_edit[R]
you_muted[R]
you_subscribed[R]
Public Class Methods
new(hash)
click to toggle source
# 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"] if @input["owner"].nil? return end @owner = UserObject.new(@input["owner"]) @type = @input["type"] @id = @input["id"] @counts = ChannelCountsObject.new(@input["counts"]) if @input["recent_message"].blank? || @input["recent_message"]["is_deleted"] return end @recent_message = PostObject.new(@input["recent_message"]) end