You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: lunar_solar_converter.rb
    path of file: ./repos/Lunar-Solar-Calendar-Converter/ruby
    
    the code of the file until where you have to start completion: # -*- coding: utf-8 -*-

class Lunar
  attr_accessor :lunar_day, :lunar_month, :lunar_year, :is_leap

  def initialize(y = 0, m = 0, d = 0, leap = false)
    @lunar_year = y
    @lunar_month =
    
  def solar_to_lunar(solar)
    lunar = Lunar.new(0, 0, 0, false)
    index = solar.solar_year - SOLAR11.first
    data = (solar.solar_year << 9) | (solar.solar_month << 5) | solar.solar_day

    index -= 1 if SOLAR11[index] > data
    solar11 = SOLAR11[index]

    y = get_bit_int(solar11, 12, 9)
    m = get_bit_int(solar11, 4, 5)
    d = get_bit_int(solar11, 5, 0)
    offset = solar_to_int(solar.solar_year, solar.solar_month, solar.solar_day) - solar_to_int(y, m, d)

    days = LUNAR_MONTH_DAYS[index]
    leap = get_bit_int(days, 4, 13)

    lunar_year = index + SOLAR11.first
    lunar_month = 1
    offset += 1

    (0..12).each do |i|
      dm = get_bit_int(days, 1, 12 - i) == 1 ? 30 : 29
      break if dm >= offset

      lunar_month += 1
      offset -= dm
    end

    lunar.lunar_year = lunar_year
    lunar.lunar_month = lunar_month
    lunar.lunar_day = offset.to_i
    lunar.is_leap = false

    if leap != 0 && lunar_month > leap
      lunar.lunar_month = lunar_month - 1

      lunar.is_leap = true if lunar_month == leap + 1
    end