Class: Cronofy::Credentials::LinkingProfile

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ LinkingProfile

Returns a new instance of LinkingProfile.



12
13
14
15
16
# File 'lib/cronofy/types.rb', line 12

def initialize(hash)
  @provider_name = hash['provider_name'] || hash[:provider_name]
  @profile_id = hash['profile_id'] || hash[:profile_id]
  @profile_name = hash['profile_name'] || hash[:profile_name]
end

Instance Attribute Details

#profile_idObject (readonly)

Returns the value of attribute profile_id.



9
10
11
# File 'lib/cronofy/types.rb', line 9

def profile_id
  @profile_id
end

#profile_nameObject (readonly)

Returns the value of attribute profile_name.



10
11
12
# File 'lib/cronofy/types.rb', line 10

def profile_name
  @profile_name
end

#provider_nameObject (readonly)

Returns the value of attribute provider_name.



8
9
10
# File 'lib/cronofy/types.rb', line 8

def provider_name
  @provider_name
end

Instance Method Details

#==(other) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/cronofy/types.rb', line 26

def ==(other)
  case other
  when LinkingProfile
    self.provider_name == other.provider_name &&
      self.profile_id == other.profile_id &&
      self.profile_name == other.profile_name
  end
end

#to_hObject



18
19
20
21
22
23
24
# File 'lib/cronofy/types.rb', line 18

def to_h
  {
    provider_name: provider_name,
    profile_id: profile_id,
    profile_name: profile_name,
  }
end