Class: NattyUI::Table::Column
Instance Attribute Summary collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, **kwargs) ⇒ Object
50
51
52
53
54
55
|
# File 'lib/natty-ui/table.rb', line 50
def method_missing(name, *args, **kwargs)
return super unless name.end_with?('=')
return super unless Cell::Attributes.public_method_defined?(name)
@parent.each_cell_of(@index) { _1.attributes.__send__(name, *args) }
args[0]
end
|
Instance Attribute Details
#index ⇒ Integer
16
17
18
|
# File 'lib/natty-ui/table.rb', line 16
def index
@index
end
|
Instance Method Details
#assign(**attributes) ⇒ Object
25
26
27
28
29
|
# File 'lib/natty-ui/table.rb', line 25
def assign(**attributes)
return self if attributes.empty?
@parent.each_cell_of(@index) { _1.attributes.merge!(**attributes) }
self
end
|
#to_s ⇒ Object
Also known as:
inspect
22
|
# File 'lib/natty-ui/table.rb', line 22
def to_s = "#{super.chop} @index:#{@index} @width:#{width.inspect}>"
|
#width ⇒ Object
18
19
20
|
# File 'lib/natty-ui/table.rb', line 18
def width
@width ||= find_width
end
|