Sha256: 5e8914230a33be050b9f872e03f89703b1d30b772a93a2d809b7bb9f25f5ab95

Contents?: true

Size: 747 Bytes

Versions: 11

Compression:

Stored size: 747 Bytes

Contents

module Guilded
  class ComponentDef
    
    attr_reader :kind, :options, :libs, :styles
    attr_accessor :additional_js
  
    def initialize( kind, options={}, libs=[], styles=[], additional_js='' )
      @kind = kind
      @options = options
      @libs = libs
      @styles = styles
      @additional_js = additional_js
    end
    
    # True if this component does not include styles.
    #
    def exclude_css?
      options.include?( :exclude_css ) && ( options[:exclude_css] == 'true' || options[:exclude_css] == true )
    end
    
    #True if this componnent does not include JavaScript.
    def exclude_js?
      options.include?( :exclude_js ) && ( options[:exclude_js] == 'true' || options[:exclude_js] == true )
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
guilded-1.1.0 lib/guilded/component_def.rb
guilded-1.0.14 lib/guilded/component_def.rb
guilded-1.0.13 lib/guilded/component_def.rb
guilded-1.0.12 lib/guilded/component_def.rb
guilded-1.0.10 lib/guilded/component_def.rb
guilded-1.0.9 lib/guilded/component_def.rb
guilded-1.0.8 lib/guilded/component_def.rb
guilded-1.0.7 lib/guilded/component_def.rb
guilded-1.0.6 lib/guilded/component_def.rb
guilded-1.0.5 lib/guilded/component_def.rb
guilded-1.0.4 lib/guilded/component_def.rb