Class: Awsm::Tablulatrix
- Inherits:
-
Object
- Object
- Awsm::Tablulatrix
- Defined in:
- lib/awsm/configure.rb
Instance Method Summary collapse
- #add_field(name, heading, &block) ⇒ Object
- #fields ⇒ Object
-
#initialize ⇒ Tablulatrix
constructor
A new instance of Tablulatrix.
- #use_fields(fields = nil) ⇒ Object
Constructor Details
#initialize ⇒ Tablulatrix
Returns a new instance of Tablulatrix.
82 83 84 85 |
# File 'lib/awsm/configure.rb', line 82 def initialize @use_fields = [] @fields = {} end |
Instance Method Details
#add_field(name, heading, &block) ⇒ Object
95 96 97 98 99 100 |
# File 'lib/awsm/configure.rb', line 95 def add_field( name, heading, &block ) @fields[ name ] = { heading: heading, block: block } end |
#fields ⇒ Object
102 103 104 |
# File 'lib/awsm/configure.rb', line 102 def fields return @fields end |
#use_fields(fields = nil) ⇒ Object
87 88 89 90 91 92 93 |
# File 'lib/awsm/configure.rb', line 87 def use_fields( fields=nil ) if fields.nil? return @use_fields end @use_fields = fields end |