Class: Teams::Cards::CardObject
- Inherits:
-
Object
- Object
- Teams::Cards::CardObject
- Defined in:
- lib/teams/cards.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(**options) ⇒ CardObject
constructor
A new instance of CardObject.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
- #with_options(options = nil, **kwargs) ⇒ Object
Constructor Details
#initialize(**options) ⇒ CardObject
Returns a new instance of CardObject.
11 12 13 |
# File 'lib/teams/cards.rb', line 11 def initialize(**) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/teams/cards.rb', line 9 def @options end |
Instance Method Details
#to_h ⇒ Object
15 16 17 |
# File 'lib/teams/cards.rb', line 15 def to_h compact_hash(()) 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 ( = nil, **kwargs) = ( || {}).merge(kwargs) .each { |key, value| with_option(key, value) } self end |