Class: ContentTagHelper::Tag::CSS

Inherits:
Object
  • Object
show all
Defined in:
lib/ecrire/app/helpers/content_tag_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(css) ⇒ CSS

Returns a new instance of CSS.



72
73
74
75
76
77
78
# File 'lib/ecrire/app/helpers/content_tag_helper.rb', line 72

def initialize(css)
  if css.is_a? String
    @internals = css.split(' ')
  else
    @internals = css.to_a
  end
end

Instance Method Details

#<<(name) ⇒ Object



88
89
90
91
# File 'lib/ecrire/app/helpers/content_tag_helper.rb', line 88

def <<(name)
  @internals << name
  nil
end

#empty?Boolean

Returns:

  • (Boolean)


84
85
86
# File 'lib/ecrire/app/helpers/content_tag_helper.rb', line 84

def empty?
  @internals.empty?
end

#to_sObject



80
81
82
# File 'lib/ecrire/app/helpers/content_tag_helper.rb', line 80

def to_s
  @internals.uniq.join(' ').html_safe
end