Sha256: c27d69163e109598ad71156dd550ad8cb9fb65d9c14838a2fd2dd47363862300

Contents?: true

Size: 518 Bytes

Versions: 23

Compression:

Stored size: 518 Bytes

Contents

module Siteleaf
  class Theme < Entity

    attr_accessor :name, :site_id
    attr_reader :id, :created_at, :updated_at
    
    def self.find_by_site_id(site_id)
      Site.new({:id => site_id}).theme
    end
    
    def self.assets_by_site_id(site_id)
      Theme.new({:site_id => site_id}).assets
    end
    
    def site
      Site.find(self.site_id)
    end
    
    def assets
      result = Client.get "sites/#{self.site_id}/theme/assets"
      result.map { |r| Asset.new(r) } if result
    end
    
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
siteleaf-1.0.11 lib/siteleaf/theme.rb
siteleaf-1.0.10 lib/siteleaf/theme.rb
siteleaf-1.0.9 lib/siteleaf/theme.rb
siteleaf-1.0.8 lib/siteleaf/theme.rb
siteleaf-1.0.7 lib/siteleaf/theme.rb
siteleaf-1.0.6 lib/siteleaf/theme.rb
siteleaf-1.0.5 lib/siteleaf/theme.rb
siteleaf-1.0.4 lib/siteleaf/theme.rb
siteleaf-1.0.3 lib/siteleaf/theme.rb
siteleaf-1.0.2 lib/siteleaf/theme.rb
siteleaf-1.0.1 lib/siteleaf/theme.rb
siteleaf-1.0.0 lib/siteleaf/theme.rb
siteleaf-0.9.23 lib/siteleaf/theme.rb
siteleaf-0.9.22 lib/siteleaf/theme.rb
siteleaf-0.9.21 lib/siteleaf/theme.rb
siteleaf-0.9.20 lib/siteleaf/theme.rb
siteleaf-0.9.19 lib/siteleaf/theme.rb
siteleaf-0.9.18 lib/siteleaf/theme.rb
siteleaf-0.9.17 lib/siteleaf/theme.rb
siteleaf-0.9.16 lib/siteleaf/theme.rb