Class: Beefcake::Message::Field
- Inherits:
-
Struct
- Object
- Struct
- Beefcake::Message::Field
- Defined in:
- lib/beefcake.rb
Instance Attribute Summary collapse
-
#fn ⇒ Object
Returns the value of attribute fn.
-
#name ⇒ Object
Returns the value of attribute name.
-
#opts ⇒ Object
Returns the value of attribute opts.
-
#rule ⇒ Object
Returns the value of attribute rule.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #<=>(o) ⇒ Object
- #is_protobuf? ⇒ Boolean
- #matches_type?(obj) ⇒ Boolean
- #optional? ⇒ Boolean
- #repeated? ⇒ Boolean
- #required? ⇒ Boolean
- #same_type?(obj) ⇒ Boolean
Instance Attribute Details
#fn ⇒ Object
Returns the value of attribute fn
32 33 34 |
# File 'lib/beefcake.rb', line 32 def fn @fn end |
#name ⇒ Object
Returns the value of attribute name
32 33 34 |
# File 'lib/beefcake.rb', line 32 def name @name end |
#opts ⇒ Object
Returns the value of attribute opts
32 33 34 |
# File 'lib/beefcake.rb', line 32 def opts @opts end |
#rule ⇒ Object
Returns the value of attribute rule
32 33 34 |
# File 'lib/beefcake.rb', line 32 def rule @rule end |
#type ⇒ Object
Returns the value of attribute type
32 33 34 |
# File 'lib/beefcake.rb', line 32 def type @type end |
Instance Method Details
#<=>(o) ⇒ Object
33 34 35 |
# File 'lib/beefcake.rb', line 33 def <=>(o) fn <=> o.fn end |
#is_protobuf? ⇒ Boolean
45 46 47 |
# File 'lib/beefcake.rb', line 45 def is_protobuf? type.is_a?(Class) and type.include?(Beefcake::Message) end |
#matches_type?(obj) ⇒ Boolean
41 42 43 |
# File 'lib/beefcake.rb', line 41 def matches_type?(obj) obj.is_a? type end |
#optional? ⇒ Boolean
51 |
# File 'lib/beefcake.rb', line 51 def optional? ; rule == :optional end |
#repeated? ⇒ Boolean
50 |
# File 'lib/beefcake.rb', line 50 def repeated? ; rule == :repeated end |
#required? ⇒ Boolean
49 |
# File 'lib/beefcake.rb', line 49 def required? ; rule == :required end |
#same_type?(obj) ⇒ Boolean
37 38 39 |
# File 'lib/beefcake.rb', line 37 def same_type?(obj) type == obj end |