Class: Browserbeam::MarkdownContent

Inherits:
Struct
  • Object
show all
Defined in:
lib/browserbeam/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#contentObject

Returns the value of attribute content

Returns:

  • (Object)

    the current value of content



2
3
4
# File 'lib/browserbeam/types.rb', line 2

def content
  @content
end

#lengthObject

Returns the value of attribute length

Returns:

  • (Object)

    the current value of length



2
3
4
# File 'lib/browserbeam/types.rb', line 2

def length
  @length
end

Class Method Details

.from_hash(data) ⇒ Object



3
4
5
6
# File 'lib/browserbeam/types.rb', line 3

def self.from_hash(data)
  return nil unless data.is_a?(Hash)
  new(content: data["content"] || "", length: data["length"])
end