Class: Trackplot::Components::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/trackplot/components/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Base

Returns a new instance of Base.



6
7
8
# File 'lib/trackplot/components/base.rb', line 6

def initialize(**options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/trackplot/components/base.rb', line 4

def options
  @options
end

Instance Method Details

#to_configObject



14
15
16
# File 'lib/trackplot/components/base.rb', line 14

def to_config
  {type: type}.merge(options).compact
end

#typeObject



10
11
12
# File 'lib/trackplot/components/base.rb', line 10

def type
  self.class.name.demodulize.underscore
end