Class: AppleModels::Device

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Device

Returns a new instance of Device.



7
8
9
# File 'lib/apple_models/device.rb', line 7

def initialize params
  params.each { |k,v| instance_variable_set("@#{k}", v) }
end

Instance Attribute Details

#identifierObject (readonly)

Returns the value of attribute identifier.



3
4
5
# File 'lib/apple_models/device.rb', line 3

def identifier
  @identifier
end

#modelObject (readonly)

Returns the value of attribute model.



3
4
5
# File 'lib/apple_models/device.rb', line 3

def model
  @model
end

#versionObject (readonly)

Returns the value of attribute version.



3
4
5
# File 'lib/apple_models/device.rb', line 3

def version
  @version
end

Instance Method Details

#friendly_nameObject



11
12
13
# File 'lib/apple_models/device.rb', line 11

def friendly_name
  "#{model} #{version}"
end