Class: Docp::TableHeader::Column

Inherits:
Object
  • Object
show all
Includes:
Docp::TableHeaderPtn
Defined in:
lib/docp/table_header.rb

Instance Attribute Summary collapse

Attributes included from Docp::TableHeaderPtn

#after_check_val, #exclude_ptn

Instance Method Summary collapse

Methods included from Docp::TableHeaderPtn

#check_ptn, #exclude_ptn?, #include_ptn?, #ptn?

Constructor Details

#initialize(hash) ⇒ Column

Returns a new instance of Column.



120
121
122
123
124
125
# File 'lib/docp/table_header.rb', line 120

def initialize hash
  @children = []
  @name, @include_ptn =  hash.shift
  @format = hash[:format] || hash[:default_format]
  @no_hash = hash[:no_hash]
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



116
117
118
# File 'lib/docp/table_header.rb', line 116

def children
  @children
end

#formatObject

Returns the value of attribute format.



119
120
121
# File 'lib/docp/table_header.rb', line 119

def format
  @format
end

#include_ptnObject (readonly)

Returns the value of attribute include_ptn.



114
115
116
# File 'lib/docp/table_header.rb', line 114

def include_ptn
  @include_ptn
end

#nameObject (readonly)

Returns the value of attribute name.



113
114
115
# File 'lib/docp/table_header.rb', line 113

def name
  @name
end

#no_hashObject (readonly)

Returns the value of attribute no_hash.



115
116
117
# File 'lib/docp/table_header.rb', line 115

def no_hash
  @no_hash
end

#requiredObject

Returns the value of attribute required.



118
119
120
# File 'lib/docp/table_header.rb', line 118

def required
  @required
end

Instance Method Details

#add(name, hash) ⇒ Object



127
128
129
130
131
# File 'lib/docp/table_header.rb', line 127

def add name, hash
  @no_hash = true
  ch = Column.new( { name => nil, }.merge(hash) )
  @children << ch
end