Class: Cadenya::Types::ProfileSpec

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email: nil, name: nil, type: nil) ⇒ ProfileSpec

Returns a new instance of ProfileSpec.



4636
4637
4638
4639
4640
# File 'lib/cadenya/types.rb', line 4636

def initialize(email: nil, name: nil, type: nil)
  @email = email
  @name = name
  @type = type
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



4634
4635
4636
# File 'lib/cadenya/types.rb', line 4634

def email
  @email
end

#nameObject (readonly)

Returns the value of attribute name.



4634
4635
4636
# File 'lib/cadenya/types.rb', line 4634

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



4634
4635
4636
# File 'lib/cadenya/types.rb', line 4634

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



4642
4643
4644
4645
4646
4647
4648
# File 'lib/cadenya/types.rb', line 4642

def self.from_json(data)
  new(
    email: data["email"],
    name: data["name"],
    type: data["type"],
  )
end

Instance Method Details

#to_hObject



4650
4651
4652
4653
4654
4655
4656
# File 'lib/cadenya/types.rb', line 4650

def to_h
  {
    email: Util.plain(@email),
    name: Util.plain(@name),
    type: Util.plain(@type),
  }.reject { |_k, v| v.nil? }
end