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.



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

def comment_count
  @comment_count
end

#contentObject (readonly)

Returns the value of attribute content.



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

def content
  @content
end

#content_htmlObject (readonly)

Returns the value of attribute content_html.



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

def content_html
  @content_html
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#description_htmlObject (readonly)

Returns the value of attribute description_html.



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

def description_html
  @description_html
end

#generated_titleObject (readonly)

Returns the value of attribute generated_title.



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

def generated_title
  @generated_title
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#stateObject (readonly)

Returns the value of attribute state.



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

def state
  @state
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

Instance Method Details

#_base_classObject



24
25
26
# File 'lib/arena/block.rb', line 24

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

#_classObject



20
21
22
# File 'lib/arena/block.rb', line 20

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

#attachmentObject



36
37
38
# File 'lib/arena/block.rb', line 36

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

#embedObject



40
41
42
# File 'lib/arena/block.rb', line 40

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

#imageObject



32
33
34
# File 'lib/arena/block.rb', line 32

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

#sourceObject



28
29
30
# File 'lib/arena/block.rb', line 28

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