Class: Teams::Cards::CardObject

Inherits:
Object
  • Object
show all
Defined in:
lib/teams/cards.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ CardObject

Returns a new instance of CardObject.



11
12
13
# File 'lib/teams/cards.rb', line 11

def initialize(**options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/teams/cards.rb', line 9

def options
  @options
end

Instance Method Details

#to_hObject



15
16
17
# File 'lib/teams/cards.rb', line 15

def to_h
  compact_hash(serialize_options(options))
end

#to_json(*args) ⇒ Object



19
20
21
# File 'lib/teams/cards.rb', line 19

def to_json(*args)
  JSON.generate(to_h, *args)
end

#with_options(options = nil, **kwargs) ⇒ Object



23
24
25
26
27
# File 'lib/teams/cards.rb', line 23

def with_options(options = nil, **kwargs)
  options = (options || {}).merge(kwargs)
  options.each { |key, value| with_option(key, value) }
  self
end