Class: MessagePack::IDL::IR::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/msgpack/idl/ir.rb

Direct Known Subclasses

Argument

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id.



294
295
296
# File 'lib/msgpack/idl/ir.rb', line 294

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



294
295
296
# File 'lib/msgpack/idl/ir.rb', line 294

def name
  @name
end

#optionObject (readonly)

Returns the value of attribute option.



294
295
296
# File 'lib/msgpack/idl/ir.rb', line 294

def option
  @option
end

#typeObject (readonly)

Returns the value of attribute type.



294
295
296
# File 'lib/msgpack/idl/ir.rb', line 294

def type
  @type
end

#valueObject (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

Returns:

  • (Boolean)


300
301
302
# File 'lib/msgpack/idl/ir.rb', line 300

def optional?
	@option == FIELD_OPTIONAL
end

#required?Boolean

Returns:

  • (Boolean)


296
297
298
# File 'lib/msgpack/idl/ir.rb', line 296

def required?
	@option == FIELD_REQUIRED
end