Class: OBSWS::Mixin::MetaObject

Inherits:
Object
  • Object
show all
Includes:
Meta
Defined in:
lib/obsws/mixin.rb

Direct Known Subclasses

Data, Response

Instance Method Summary collapse

Methods included from Meta

#make_field_methods

Constructor Details

#initialize(resp, fields) ⇒ MetaObject

Returns a new instance of MetaObject.



17
18
19
20
21
# File 'lib/obsws/mixin.rb', line 17

def initialize(resp, fields)
  @resp = resp
  @fields = fields
  make_field_methods(*fields)
end

Instance Method Details

#attrsObject



25
# File 'lib/obsws/mixin.rb', line 25

def attrs = @fields.map { |f| f.to_s.snakecase }

#empty?Boolean

Returns:

  • (Boolean)


23
# File 'lib/obsws/mixin.rb', line 23

def empty? = @fields.empty?