Sha256: 57348d12206df301d9bfd7b960650fc50accf1ee9e80e2b09e2b9b62718ff15f

Contents?: true

Size: 1.28 KB

Versions: 25

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

module Molecule
  def new(params, &bloc)
    if params[:page]
      site_found = grab(params[:page][:application])
      site_found.clear(true)
      page_id = params[:page][:name]
      site_found.box({ id: page_id })
    elsif params[:application]

      footer_header_size=33
      footer_header_color=color({red: 0, green: 0, blue: 0, id: :footer_header_color})

      if params[:header]
        top = footer_header_size
        header=box({ left: 0, right: 0, width: :auto, top: 0, height: top, id: :header })
        # header.attach(:footer_header_color)
      else
        top = 0
        end
        if params[:footer]
          bottom = footer_header_size
          box({ left: 0, right: 0, width: :auto, top: :auto, bottom: 0, height: bottom, id: :footer })
        else
          bottom = 0
        end
        box({ left: 0, right: 0, width: :auto, top: top, bottom: bottom, height: :auto, id: params[:application] })
        elsif params[:module]

      end
      super if defined?(super)
    end
  end

  class Object
    include Molecule
  end

  # tests
  # new({application: :compose, header: true, footer: true })
  #
  # new(page: {name: :home, application: :compose, attach: :root })
  #
  # new(module: {name: :home, application: :compose, attach: :root })






Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
atome-0.5.6.8.7 lib/molecules/init.rb
atome-0.5.6.8.6 lib/molecules/init.rb
atome-0.5.6.8.5 lib/molecules/init.rb
atome-0.5.6.8.3 lib/molecules/init.rb
atome-0.5.6.7.8 lib/molecules/init.rb
atome-0.5.6.7.7 lib/molecules/init.rb
atome-0.5.6.7.6 lib/molecules/init.rb
atome-0.5.6.7.5 lib/molecules/init.rb
atome-0.5.6.7.4 lib/molecules/init.rb
atome-0.5.6.7.3 lib/molecules/init.rb
atome-0.5.6.6.9 lib/molecules/init.rb
atome-0.5.6.6.7 lib/molecules/init.rb
atome-0.5.6.6.5 lib/molecules/init.rb
atome-0.5.6.6.1 lib/molecules/init.rb
atome-0.5.6.6.0 lib/molecules/init.rb
atome-0.5.6.5.7 lib/molecules/init.rb
atome-0.5.6.5.6 lib/molecules/init.rb
atome-0.5.6.5.4 lib/molecules/init.rb
atome-0.5.6.5.1 lib/molecules/init.rb
atome-0.5.6.4.8 lib/molecules/init.rb