Class: Sambot::Slack::ProductTag
- Inherits:
-
Object
- Object
- Sambot::Slack::ProductTag
- Defined in:
- lib/sambot/slack/product_tag.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, name) ⇒ ProductTag
constructor
A new instance of ProductTag.
Constructor Details
#initialize(id, name) ⇒ ProductTag
Returns a new instance of ProductTag.
7 8 9 10 |
# File 'lib/sambot/slack/product_tag.rb', line 7 def initialize(id, name) @id = id @name = name end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/sambot/slack/product_tag.rb', line 5 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/sambot/slack/product_tag.rb', line 5 def name @name end |
Class Method Details
.find(client, name) ⇒ Object
12 13 14 15 |
# File 'lib/sambot/slack/product_tag.rb', line 12 def self.find(client, name) query = "SELECT Id, Name FROM ADM_Product_Tag__c WHERE Active__c = true AND Name = '#{name}'" client.query(query).map {|x| ProductTag.new(x[:Id], x[:Name]) }[0] end |