Class: SixSaferpay::Styling

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/models/styling.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(css_url: nil, content_security_enabled: nil, theme: nil) ⇒ Styling

Returns a new instance of Styling.



6
7
8
9
10
# File 'lib/six_saferpay/models/styling.rb', line 6

def initialize(css_url: nil, content_security_enabled: nil, theme: nil)
  @css_url = css_url || SixSaferpay.config.css_url
  @content_security_enabled = content_security_enabled
  @theme = theme
end

Instance Attribute Details

#content_security_enabledObject

Returns the value of attribute content_security_enabled.



4
5
6
# File 'lib/six_saferpay/models/styling.rb', line 4

def content_security_enabled
  @content_security_enabled
end

#css_urlObject

Returns the value of attribute css_url.



4
5
6
# File 'lib/six_saferpay/models/styling.rb', line 4

def css_url
  @css_url
end

#themeObject

Returns the value of attribute theme.



4
5
6
# File 'lib/six_saferpay/models/styling.rb', line 4

def theme
  @theme
end

Instance Method Details

#to_hashObject Also known as: to_h



12
13
14
15
16
17
18
# File 'lib/six_saferpay/models/styling.rb', line 12

def to_hash
  hash = Hash.new
  hash.merge!(css_url: @css_url) if @css_url
  hash.merge!(content_security_enabled: @content_security_enabled) if !@content_security_enabled.nil?
  hash.merge!(theme: @theme) if @theme
  hash
end