Class: Arena::Block

Inherits:
Base
  • Object
show all
Includes:
Connectable, Creatable
Defined in:
lib/arena/block.rb

Direct Known Subclasses

Attachment, Image, Link, Media, Text

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods included from Connectable

#connected_at, #connected_by, #connected_by_different_user?, #connections, #is_block?, #user

Methods included from Creatable

#created_at, #updated_at

Methods inherited from Base

attr_reader, #initialize

Constructor Details

This class inherits a constructor from Arena::Base

Instance Attribute Details

#comment_countObject (readonly)

Returns the value of attribute comment_count.



15
16
17
# File 'lib/arena/block.rb', line 15

def comment_count
  @comment_count
end

#contentObject (readonly)

Returns the value of attribute content.



15
16
17
# File 'lib/arena/block.rb', line 15

def content
  @content
end

#content_htmlObject (readonly)

Returns the value of attribute content_html.



15
16
17
# File 'lib/arena/block.rb', line 15

def content_html
  @content_html
end

#descriptionObject (readonly)

Returns the value of attribute description.



15
16
17
# File 'lib/arena/block.rb', line 15

def description
  @description
end

#description_htmlObject (readonly)

Returns the value of attribute description_html.



15
16
17
# File 'lib/arena/block.rb', line 15

def description_html
  @description_html
end

#generated_titleObject (readonly)

Returns the value of attribute generated_title.



15
16
17
# File 'lib/arena/block.rb', line 15

def generated_title
  @generated_title
end

#idObject (readonly)

Returns the value of attribute id.



15
16
17
# File 'lib/arena/block.rb', line 15

def id
  @id
end

#stateObject (readonly)

Returns the value of attribute state.



15
16
17
# File 'lib/arena/block.rb', line 15

def state
  @state
end

#titleObject (readonly)

Returns the value of attribute title.



15
16
17
# File 'lib/arena/block.rb', line 15

def title
  @title
end

Instance Method Details

#_base_classObject



22
23
24
# File 'lib/arena/block.rb', line 22

def _base_class
  @_base_class ||= @attrs['base_class']
end

#_classObject



18
19
20
# File 'lib/arena/block.rb', line 18

def _class
  @_class ||= @attrs['class']
end

#attachmentObject



34
35
36
# File 'lib/arena/block.rb', line 34

def attachment
  @attachment ||= Arena::Entity::Attachment.new(@attrs['attachment']) if has_attachment?
end

#embedObject



38
39
40
# File 'lib/arena/block.rb', line 38

def embed
  @embed ||= Arena::Entity::Embed.new(@attrs['embed']) if has_embed?
end

#imageObject



30
31
32
# File 'lib/arena/block.rb', line 30

def image
  @image ||= Arena::Entity::Image.new(@attrs['image']) if has_image?
end

#sourceObject



26
27
28
# File 'lib/arena/block.rb', line 26

def source
  @source ||= Arena::Entity::Source.new(@attrs['source']) if !@attrs['source'].nil?
end