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.



68
69
70
71
72
73
74
# File 'lib/ecrire/app/helpers/content_tag_helper.rb', line 68

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

Instance Method Details

#<<(name) ⇒ Object



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

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

#empty?Boolean

Returns:

  • (Boolean)


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

def empty?
  @internals.empty?
end

#to_sObject



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

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