Class: Datalab::MarkerOptions
- Inherits:
-
Object
- Object
- Datalab::MarkerOptions
- Includes:
- DynamicSchema::Definable
- Defined in:
- lib/datalab/marker_options.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}, api_options: nil) ⇒ MarkerOptions
constructor
A new instance of MarkerOptions.
- #to_h ⇒ Object
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( = {}, api_options: nil ) @options = self.class.builder.build( || {} ) @options = .merge( @options ) if @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( = nil, &block ) new( api_options: builder.build( , &block ) ) end |
.build!(options = nil, &block) ⇒ Object
17 18 19 |
# File 'lib/datalab/marker_options.rb', line 17 def self.build!( = nil, &block ) new( api_options: builder.build!( , &block ) ) end |
Instance Method Details
#to_h ⇒ Object
27 28 29 |
# File 'lib/datalab/marker_options.rb', line 27 def to_h @options.to_h end |