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.
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/postrunner/FlexiTable.rb', line 23 def initialize(attrs = {}) @min_terminal_width = nil @halign = nil @width = 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.
21 22 23 |
# File 'lib/postrunner/FlexiTable.rb', line 21 def halign @halign end |
#min_terminal_width ⇒ Object
Returns the value of attribute min_terminal_width.
21 22 23 |
# File 'lib/postrunner/FlexiTable.rb', line 21 def min_terminal_width @min_terminal_width end |
Instance Method Details
#[](name) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/postrunner/FlexiTable.rb', line 37 def [](name) ivar_name = '@' + name.to_s return nil unless instance_variable_defined?(ivar_name) instance_variable_get(ivar_name) end |