Class: IOSProfile

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



2
3
4
# File 'lib/moki_ruby/iosprofile.rb', line 2

def description
  @description
end

#displayNameObject

Returns the value of attribute displayName.



2
3
4
# File 'lib/moki_ruby/iosprofile.rb', line 2

def displayName
  @displayName
end

#idObject

Returns the value of attribute id.



2
3
4
# File 'lib/moki_ruby/iosprofile.rb', line 2

def id
  @id
end

#identifierObject

Returns the value of attribute identifier.



2
3
4
# File 'lib/moki_ruby/iosprofile.rb', line 2

def identifier
  @identifier
end

#lastSeenObject

Returns the value of attribute lastSeen.



2
3
4
# File 'lib/moki_ruby/iosprofile.rb', line 2

def lastSeen
  @lastSeen
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/moki_ruby/iosprofile.rb', line 2

def name
  @name
end

Class Method Details

.from_hash(input_hash) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/moki_ruby/iosprofile.rb', line 4

def self.from_hash(input_hash)
  new_profile = self.new
  %w(id lastSeen name displayName description identifier).each do |attr|
    new_profile.send("#{ attr }=", input_hash[attr])
  end

  new_profile
end

Instance Method Details

#to_hashObject



13
14
15
16
17
18
19
# File 'lib/moki_ruby/iosprofile.rb', line 13

def to_hash
  {}.tap do |hash|
    self.instance_variables.each do |var|
      hash[var.to_s.delete("@")] = instance_variable_get(var)
    end
  end
end