Class: Seek::SampleTemplates::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/seek/sample_templates/column.rb

Overview

Describes a column in the template. The name is the text put in the top row, and contents will create a dropdown in the row below unless empty

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, contents = []) ⇒ Column

Returns a new instance of Column.



9
10
11
12
# File 'lib/seek/sample_templates/column.rb', line 9

def initialize(name, contents = [])
  @name = name
  @contents = contents
end

Instance Attribute Details

#contentsObject (readonly)

Returns the value of attribute contents.



7
8
9
# File 'lib/seek/sample_templates/column.rb', line 7

def contents
  @contents
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/seek/sample_templates/column.rb', line 7

def name
  @name
end

Instance Method Details

#as_jsonObject



14
15
16
# File 'lib/seek/sample_templates/column.rb', line 14

def as_json
  { @name => @contents }
end