Class: Browserless::StyleTag

Inherits:
Object
  • Object
show all
Defined in:
lib/browserless/style_tag.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(style_tag = nil) ⇒ StyleTag

Returns a new instance of StyleTag.



7
8
9
# File 'lib/browserless/style_tag.rb', line 7

def initialize(style_tag = nil)
  @style_tag = style_tag
end

Instance Attribute Details

#style_tagObject (readonly)

Returns the value of attribute style_tag.



5
6
7
# File 'lib/browserless/style_tag.rb', line 5

def style_tag
  @style_tag
end

Instance Method Details

#to_hObject



11
12
13
14
15
# File 'lib/browserless/style_tag.rb', line 11

def to_h
  return {content: nil} if config_value.nil?

  config_value.start_with?("http") ? {url: config_value} : {content: config_value}
end