Class: Bling::API::Record

Inherits:
Object
  • Object
show all
Defined in:
lib/bling/api/record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Record

Returns a new instance of Record.



9
10
11
# File 'lib/bling/api/record.rb', line 9

def initialize(hash)
  @attrs = hash
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



15
16
17
18
19
20
21
# File 'lib/bling/api/record.rb', line 15

def method_missing(method, *args, &block)
  if attrs.has_key?(method)
    attrs[method]
  else
    super(method, args, block)
  end
end

Instance Attribute Details

#attrsHash (readonly)

Returns The original hash attributes passed on initialize.

Returns:

  • (Hash)

    The original hash attributes passed on initialize



6
7
8
# File 'lib/bling/api/record.rb', line 6

def attrs
  @attrs
end