Class: ITunesObserver::Result

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Result

Returns a new instance of Result.



90
91
92
# File 'lib/itunes_observer.rb', line 90

def initialize(attributes)
  @attributes = attributes
end

Instance Method Details

#[](key) ⇒ Object



94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/itunes_observer.rb', line 94

def [](key)
  case value = @attributes[key]
  when OSX::NSMutableString
    value.to_s
  when OSX::NSCFString
    value.to_s
  when OSX::NSNumber
    value.to_i
  else
    value
  end
end