Method: FoxPage::Model.def_parser
- Defined in:
- lib/fox_page/model.rb
.def_parser(attribute, &parser) ⇒ Object
define a parser method for attributes
127 128 129 130 131 |
# File 'lib/fox_page/model.rb', line 127 def self.def_parser(attribute, &parser) define_method(attribute) do parser.call(@__ostruct[attribute]) end end |