Sha256: efb1f02e2b24d7cc8f3e7f83436de709979944a20c1d44cf5f7ec36cc9c49577

Contents?: true

Size: 720 Bytes

Versions: 1

Compression:

Stored size: 720 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

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
locomotivecms_wagon-2.0.0.pre.alpha.3 lib/locomotive/wagon/decorators/site_decorator.rb