Class: Guilded::ComponentDef

Inherits:
Object
  • Object
show all
Defined in:
lib/guilded/component_def.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind, options = {}, libs = [], styles = [], additional_js = '') ⇒ ComponentDef

Returns a new instance of ComponentDef.



7
8
9
10
11
12
13
# File 'lib/guilded/component_def.rb', line 7

def initialize( kind, options={}, libs=[], styles=[], additional_js='' )
  @kind = kind
  @options = options
  @libs = libs
  @styles = styles
  @additional_js = additional_js
end

Instance Attribute Details

#additional_jsObject

Returns the value of attribute additional_js.



5
6
7
# File 'lib/guilded/component_def.rb', line 5

def additional_js
  @additional_js
end

#kindObject (readonly)

Returns the value of attribute kind.



4
5
6
# File 'lib/guilded/component_def.rb', line 4

def kind
  @kind
end

#libsObject (readonly)

Returns the value of attribute libs.



4
5
6
# File 'lib/guilded/component_def.rb', line 4

def libs
  @libs
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/guilded/component_def.rb', line 4

def options
  @options
end

#stylesObject (readonly)

Returns the value of attribute styles.



4
5
6
# File 'lib/guilded/component_def.rb', line 4

def styles
  @styles
end

Instance Method Details

#exclude_css?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/guilded/component_def.rb', line 15

def exclude_css?
  options.include?( :exclude_css ) && ( options[:exclude_css] == 'true' || options[:exclude_css] == true )
end

#exclude_js?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/guilded/component_def.rb', line 19

def exclude_js?
  options.include?( :exclude_js ) && ( options[:exclude_js] == 'true' || options[:exclude_js] == true )
end