Class: Ayadn::ChannelObject

Inherits:
Object show all
Defined in:
lib/ayadn/channel_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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
66
67
68
# 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"])
    @recent_message = @input["recent_message"].nil? ? nil : PostObject.new(@input["recent_message"])
end

Instance Attribute Details

#annotationsObject (readonly)

Returns the value of attribute annotations.



45
46
47
# File 'lib/ayadn/channel_object.rb', line 45

def annotations
  @annotations
end

#countsObject (readonly)

Returns the value of attribute counts.



45
46
47
# File 'lib/ayadn/channel_object.rb', line 45

def counts
  @counts
end

#editorsObject (readonly)

Returns the value of attribute editors.



45
46
47
# File 'lib/ayadn/channel_object.rb', line 45

def editors
  @editors
end

#has_unreadObject (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

#idObject (readonly)

Returns the value of attribute id.



45
46
47
# File 'lib/ayadn/channel_object.rb', line 45

def id
  @id
end

#inputObject (readonly)

Returns the value of attribute input.



45
46
47
# File 'lib/ayadn/channel_object.rb', line 45

def input
  @input
end

#is_inactiveObject (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

#ownerObject (readonly)

Returns the value of attribute owner.



45
46
47
# File 'lib/ayadn/channel_object.rb', line 45

def owner
  @owner
end

#pagination_idObject (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

#readersObject (readonly)

Returns the value of attribute readers.



45
46
47
# File 'lib/ayadn/channel_object.rb', line 45

def readers
  @readers
end

#recent_messageObject (readonly)

Returns the value of attribute recent_message.



45
46
47
# File 'lib/ayadn/channel_object.rb', line 45

def recent_message
  @recent_message
end

#recent_message_idObject (readonly)

Returns the value of attribute recent_message_id.



45
46
47
# File 'lib/ayadn/channel_object.rb', line 45

def recent_message_id
  @recent_message_id
end

#typeObject (readonly)

Returns the value of attribute type.



45
46
47
# File 'lib/ayadn/channel_object.rb', line 45

def type
  @type
end

#writersObject (readonly)

Returns the value of attribute writers.



45
46
47
# File 'lib/ayadn/channel_object.rb', line 45

def writers
  @writers
end

#you_can_editObject (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_mutedObject (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_subscribedObject (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