Class: MessagePack::IDL::IR::Field
- Inherits:
-
Object
- Object
- MessagePack::IDL::IR::Field
- Defined in:
- lib/msgpack/idl/ir.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#option ⇒ Object
readonly
Returns the value of attribute option.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(o) ⇒ Object
-
#initialize(id, type, name, option, value) ⇒ Field
constructor
A new instance of Field.
- #optional? ⇒ Boolean
- #required? ⇒ Boolean
Constructor Details
#initialize(id, type, name, option, value) ⇒ Field
Returns a new instance of Field.
286 287 288 289 290 291 292 |
# File 'lib/msgpack/idl/ir.rb', line 286 def initialize(id, type, name, option, value) @id = id @type = type @name = name @option = option @value = value end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
294 295 296 |
# File 'lib/msgpack/idl/ir.rb', line 294 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
294 295 296 |
# File 'lib/msgpack/idl/ir.rb', line 294 def name @name end |
#option ⇒ Object (readonly)
Returns the value of attribute option.
294 295 296 |
# File 'lib/msgpack/idl/ir.rb', line 294 def option @option end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
294 295 296 |
# File 'lib/msgpack/idl/ir.rb', line 294 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
294 295 296 |
# File 'lib/msgpack/idl/ir.rb', line 294 def value @value end |
Instance Method Details
#==(o) ⇒ Object
304 305 306 307 |
# File 'lib/msgpack/idl/ir.rb', line 304 def ==(o) o.class == self.class && @id == o.id && @type == o.type && @name == o.name && @option == o.option && @value == o.value end |
#optional? ⇒ Boolean
300 301 302 |
# File 'lib/msgpack/idl/ir.rb', line 300 def optional? @option == FIELD_OPTIONAL end |
#required? ⇒ Boolean
296 297 298 |
# File 'lib/msgpack/idl/ir.rb', line 296 def required? @option == FIELD_REQUIRED end |