Sha256: b29891edea1f79c98555f94e099c45554c88ae92d4473a7d2a3abd81bb2c0ec5

Contents?: true

Size: 830 Bytes

Versions: 2

Compression:

Stored size: 830 Bytes

Contents

module Locomotive
  module Wagon

    class SiteDecorator < SimpleDelegator

      include ToHashConcern

      def domains
        (__getobj__.domains || []) - ['localhost']
      end

      def picture
        picture_path = __getobj__.picture
        if picture_path && File.exists?(picture_path)
          Locomotive::Coal::UploadIO.new(picture_path, nil, 'icon.png')
        end
      end

      %i(robots_txt locales timezone seo_title meta_keywords meta_description).each do |name|
        define_method(name) do
          self[name]
        end
      end

      def __attributes__
        %i(name handle robots_txt locales timezone seo_title meta_keywords meta_description picture)
      end

    end

    class IconSiteDecorator < SiteDecorator

      def __attributes__
        %i(picture)
      end

    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
locomotivecms_wagon-2.0.0.pre.beta.2 lib/locomotive/wagon/decorators/site_decorator.rb
locomotivecms_wagon-2.0.0.pre.beta.1 lib/locomotive/wagon/decorators/site_decorator.rb