Class: OpenHAB::CoreExt::Java::Month
- Inherits:
 - 
      Object
      
        
- Object
 - OpenHAB::CoreExt::Java::Month
 
 
- Defined in:
 - lib/openhab/core_ext/java/month.rb
 
Overview
Extensions to javajava.timejava.time.Month
Instance Method Summary collapse
- #+(other) ⇒ Month
 - #-(other) ⇒ Month
 - 
  
    
      #succ  ⇒ Month 
    
    
  
  
  
  
  
  
  
  
  
    
Returns the next month.
 - #to_date(context = nil) ⇒ Date
 - #to_instant(context = nil) ⇒ Instant
 - #to_local_date(context = nil) ⇒ LocalDate
 - #to_month ⇒ self
 - #to_month_day ⇒ MonthDay
 - #to_zoned_date_time(context = nil) ⇒ ZonedDateTime
 
Methods included from Time
Methods included from Between
Instance Method Details
#+(other) ⇒ Month
      17 18 19  | 
    
      # File 'lib/openhab/core_ext/java/month.rb', line 17 def +(other) plus(other) end  | 
  
#-(other) ⇒ Month
      22 23 24  | 
    
      # File 'lib/openhab/core_ext/java/month.rb', line 22 def -(other) minus(other) end  | 
  
#succ ⇒ Month
Returns the next month
Will loop back to January if necessary.
      33 34 35  | 
    
      # File 'lib/openhab/core_ext/java/month.rb', line 33 def succ plus(1) end  | 
  
#to_date(context = nil) ⇒ Date
      45 46 47  | 
    
      # File 'lib/openhab/core_ext/java/month.rb', line 45 def to_date(context = nil) to_local_date(context).to_date end  | 
  
#to_instant(context = nil) ⇒ Instant
      72 73 74 75  | 
    
      # File 'lib/openhab/core_ext/java/month.rb', line 72 def to_instant(context = nil) context ||= Instant.now.to_zoned_date_time to_local_date(context).to_instant end  | 
  
#to_local_date(context = nil) ⇒ LocalDate
      38 39 40 41 42  | 
    
      # File 'lib/openhab/core_ext/java/month.rb', line 38 def to_local_date(context = nil) context ||= java.time.Year.now year = java.time.Year.from(context) year.at_month_day(to_month_day) end  | 
  
#to_month ⇒ self
      50 51 52  | 
    
      # File 'lib/openhab/core_ext/java/month.rb', line 50 def to_month self end  | 
  
#to_month_day ⇒ MonthDay
      55 56 57  | 
    
      # File 'lib/openhab/core_ext/java/month.rb', line 55 def to_month_day MonthDay.of(self, 1) end  | 
  
#to_zoned_date_time(context = nil) ⇒ ZonedDateTime
      63 64 65  | 
    
      # File 'lib/openhab/core_ext/java/month.rb', line 63 def to_zoned_date_time(context = nil) to_local_date(context).to_zoned_date_time(context) end  |