Class: EasyTalk::Builders::TemporalBuilder

Inherits:
StringBuilder show all
Defined in:
lib/easy_talk/builders/temporal_builder.rb

Overview

Builder class for temporal properties (date, datetime, time).

Direct Known Subclasses

DateBuilder, DatetimeBuilder, TimeBuilder

Defined Under Namespace

Classes: DateBuilder, DatetimeBuilder, TimeBuilder

Constant Summary

Constants inherited from StringBuilder

StringBuilder::VALID_OPTIONS

Constants inherited from BaseBuilder

BaseBuilder::COMMON_OPTIONS

Instance Attribute Summary

Attributes inherited from BaseBuilder

#options, #property_name

Instance Method Summary collapse

Methods inherited from BaseBuilder

#build, collection_type?

Constructor Details

#initialize(property_name, options = {}, format = nil) ⇒ TemporalBuilder

Initializes a new instance of the TemporalBuilder class.

Parameters:

  • property_name (Symbol)

    The name of the property.

  • options (Hash) (defaults to: {})

    The options for the builder.

  • format (String) (defaults to: nil)

    The format of the temporal property (date, date-time, time).



14
15
16
17
# File 'lib/easy_talk/builders/temporal_builder.rb', line 14

def initialize(property_name, options = {}, format = nil)
  super(property_name, options)
  @format = format
end

Instance Method Details

#schemaObject



21
22
23
24
25
# File 'lib/easy_talk/builders/temporal_builder.rb', line 21

def schema
  super.tap do |schema|
    schema[:format] = @format if @format
  end
end