Class: Crubyflie::TOCElement

Inherits:
Object
  • Object
show all
Defined in:
lib/crubyflie/crazyflie/toc.rb

Overview

Base class for a TocElement. To be extended by specific classes

Direct Known Subclasses

LogTOCElement, ParamTOCElement

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element_h) ⇒ TOCElement

Returns a new instance of TOCElement.



30
31
32
33
34
35
36
37
38
# File 'lib/crubyflie/crazyflie/toc.rb', line 30

def initialize(element_h)
    @ident = element_h.delete(:ident) || 0
    @group  = element_h.delete(:group) || ""
    @name  = element_h.delete(:name) || ""
    @ctype = element_h.delete(:ctype) || ""
    @type_id = element_h.delete(:type_id) || -1
    @directive = element_h.delete(:directive) || ""
    @access = element_h.delete(:access) || 0
end

Instance Attribute Details

#accessObject (readonly)

Initializes a TOC element

Parameters:

  • element_h (Hash)

    indicates :ident, :group, :name, :ctype, :rtype, :access



29
30
31
# File 'lib/crubyflie/crazyflie/toc.rb', line 29

def access
  @access
end

#ctypeObject (readonly)

Initializes a TOC element

Parameters:

  • element_h (Hash)

    indicates :ident, :group, :name, :ctype, :rtype, :access



29
30
31
# File 'lib/crubyflie/crazyflie/toc.rb', line 29

def ctype
  @ctype
end

#directiveObject (readonly)

Initializes a TOC element

Parameters:

  • element_h (Hash)

    indicates :ident, :group, :name, :ctype, :rtype, :access



29
30
31
# File 'lib/crubyflie/crazyflie/toc.rb', line 29

def directive
  @directive
end

#groupObject (readonly)

Initializes a TOC element

Parameters:

  • element_h (Hash)

    indicates :ident, :group, :name, :ctype, :rtype, :access



29
30
31
# File 'lib/crubyflie/crazyflie/toc.rb', line 29

def group
  @group
end

#identObject (readonly)

Initializes a TOC element

Parameters:

  • element_h (Hash)

    indicates :ident, :group, :name, :ctype, :rtype, :access



29
30
31
# File 'lib/crubyflie/crazyflie/toc.rb', line 29

def ident
  @ident
end

#nameObject (readonly)

Initializes a TOC element

Parameters:

  • element_h (Hash)

    indicates :ident, :group, :name, :ctype, :rtype, :access



29
30
31
# File 'lib/crubyflie/crazyflie/toc.rb', line 29

def name
  @name
end

#type_idObject (readonly)

Initializes a TOC element

Parameters:

  • element_h (Hash)

    indicates :ident, :group, :name, :ctype, :rtype, :access



29
30
31
# File 'lib/crubyflie/crazyflie/toc.rb', line 29

def type_id
  @type_id
end