Class: SelfSDK::Services::Facts::Group

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, icon = "") ⇒ Group

Returns a new instance of Group.



140
141
142
143
# File 'lib/services/facts.rb', line 140

def initialize(name, icon = "")
  @name = name
  @icon = icon
end

Instance Attribute Details

#iconObject

Returns the value of attribute icon.



138
139
140
# File 'lib/services/facts.rb', line 138

def icon
  @icon
end

#nameObject

Returns the value of attribute name.



138
139
140
# File 'lib/services/facts.rb', line 138

def name
  @name
end

Instance Method Details

#to_hashObject



145
146
147
148
149
# File 'lib/services/facts.rb', line 145

def to_hash
  b = { name: @name }
  b[:icon] = @icon unless @icon.empty?
  b
end