Class: Easy::Api::RawAttributesResult

Inherits:
Object
  • Object
show all
Defined in:
lib/easy/api/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRawAttributesResult



107
108
109
# File 'lib/easy/api/result.rb', line 107

def initialize
  @attributes = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args) ⇒ Object



113
114
115
116
117
118
119
120
# File 'lib/easy/api/result.rb', line 113

def method_missing(symbol, *args)
  if symbol =~ /.+=/
    attr_name = symbol.to_s[0..-2]
    @attributes[attr_name] = args.first
  else
    super
  end
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



111
112
113
# File 'lib/easy/api/result.rb', line 111

def attributes
  @attributes
end