Class: Ledge::Row

Inherits:
Object
  • Object
show all
Defined in:
lib/ledge/row.rb

Constant Summary collapse

ROW_TYPES =
{
  "heading" => Ledge::RowHeading
}

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Row

Returns a new instance of Row.



17
18
19
# File 'lib/ledge/row.rb', line 17

def initialize content
  @content = content
end

Class Method Details

.row_from(data) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/ledge/row.rb', line 9

def self.row_from data
  unless ROW_TYPES[data["type"]].nil?
    ROW_TYPES[data["type"]].new data["content"]
  else
    Ledge::Row.new data["content"]
  end
end

Instance Method Details

#renderObject



21
22
23
# File 'lib/ledge/row.rb', line 21

def render
  @content
end