Class: TimeScales::Parts::DayOfQuarterClass

Inherits:
AbstractPart show all
Includes:
Singleton
Defined in:
lib/time_scales/parts.rb

Instance Method Summary collapse

Methods inherited from AbstractPart

#===, #name, #scale, #subdivision_name, #to_s, #to_time_scales_part

Instance Method Details

#&(time) ⇒ Object



193
194
195
196
197
198
199
# File 'lib/time_scales/parts.rb', line 193

def &(time)
  month_offs = time.month - 1
  qtr_offs = month_offs / 3
  qtr_start_mo = ( qtr_offs * 3 ) + 1
  qtr_start_time = Time.new( time.year, qtr_start_mo, 1)
  time.yday - qtr_start_time.yday + 1
end

#component_mixinObject



190
# File 'lib/time_scales/parts.rb', line 190

def component_mixin ; Frame::PartComponents::HasDayOfQuarter ; end

#default_for_unit?Boolean

Returns:

  • (Boolean)


189
# File 'lib/time_scales/parts.rb', line 189

def default_for_unit? ; false ; end

#scheme_scoped_precision_mixinObject



191
# File 'lib/time_scales/parts.rb', line 191

def scheme_scoped_precision_mixin ; Frame::Precisions::HasDayOfSchemePrecision ; end

#scopeObject



188
# File 'lib/time_scales/parts.rb', line 188

def scope       ; Units::Quarter ; end

#subdivisionObject



187
# File 'lib/time_scales/parts.rb', line 187

def subdivision ; Units::Day     ; end

#symbolObject



186
# File 'lib/time_scales/parts.rb', line 186

def symbol ; :day_of_quarter ; end