Class: PostRunner::FlexiTable::Attributes
- Inherits:
-
Object
- Object
- PostRunner::FlexiTable::Attributes
- Defined in:
- lib/postrunner/FlexiTable.rb
Instance Attribute Summary collapse
-
#halign ⇒ Object
Returns the value of attribute halign.
-
#min_terminal_width ⇒ Object
Returns the value of attribute min_terminal_width.
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(attrs = {}) ⇒ Attributes
constructor
A new instance of Attributes.
Constructor Details
#initialize(attrs = {}) ⇒ Attributes
Returns a new instance of Attributes.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/postrunner/FlexiTable.rb', line 11 def initialize(attrs = {}) @min_terminal_width = nil @halign = nil attrs.each do |name, value| ivar_name = '@' + name.to_s unless instance_variable_defined?(ivar_name) Log.fatal "Unsupported attribute #{name}" end instance_variable_set(ivar_name, value) end end |
Instance Attribute Details
#halign ⇒ Object
Returns the value of attribute halign.
9 10 11 |
# File 'lib/postrunner/FlexiTable.rb', line 9 def halign @halign end |
#min_terminal_width ⇒ Object
Returns the value of attribute min_terminal_width.
9 10 11 |
# File 'lib/postrunner/FlexiTable.rb', line 9 def min_terminal_width @min_terminal_width end |
Instance Method Details
#[](name) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/postrunner/FlexiTable.rb', line 24 def [](name) ivar_name = '@' + name.to_s return nil unless instance_variable_defined?(ivar_name) instance_variable_get(ivar_name) end |