module Beefcake::Message::Dsl
Public Instance Methods
Source
# File lib/beefcake.rb, line 68 def field(rule, name, type, fn, opts) if fields.include?(fn) raise DuplicateFieldNumber.new(fn, name) end fields[fn] = Field.new(rule, name, type, fn, opts) attr_accessor name end
Source
# File lib/beefcake.rb, line 64 def optional(name, type, fn, opts={}) field(:optional, name, type, fn, opts) end
Source
# File lib/beefcake.rb, line 60 def repeated(name, type, fn, opts={}) field(:repeated, name, type, fn, opts) end
Source
# File lib/beefcake.rb, line 56 def required(name, type, fn, opts={}) field(:required, name, type, fn, opts) end