Class: Datalab::MarkerOptions

Inherits:
Object
  • Object
show all
Includes:
DynamicSchema::Definable
Defined in:
lib/datalab/marker_options.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, api_options: nil) ⇒ MarkerOptions

Returns a new instance of MarkerOptions.



21
22
23
24
25
# File 'lib/datalab/marker_options.rb', line 21

def initialize( options = {}, api_options: nil )
  @options = self.class.builder.build( options || {} )
  @options = api_options.merge( @options ) if api_options 
  @options[ :formats ]&.map! { | format | string_camelize( format.to_s ) }
end

Class Method Details

.build(options = nil, &block) ⇒ Object



13
14
15
# File 'lib/datalab/marker_options.rb', line 13

def self.build( options = nil, &block )
  new( api_options: builder.build( options, &block ) )
end

.build!(options = nil, &block) ⇒ Object



17
18
19
# File 'lib/datalab/marker_options.rb', line 17

def self.build!( options = nil, &block )
  new( api_options: builder.build!( options, &block ) )
end

Instance Method Details

#to_hObject



27
28
29
# File 'lib/datalab/marker_options.rb', line 27

def to_h
  @options.to_h 
end