Class: GnipApi::Apis::PowerTrack::Rule
- Inherits:
-
Object
- Object
- GnipApi::Apis::PowerTrack::Rule
- Defined in:
- lib/gnip_api/apis/power_track/rule.rb
Instance Attribute Summary collapse
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(params = {}) ⇒ Rule
constructor
A new instance of Rule.
- #to_json ⇒ Object
- #uid ⇒ Object
Constructor Details
permalink #initialize(params = {}) ⇒ Rule
Returns a new instance of Rule.
7 8 9 10 |
# File 'lib/gnip_api/apis/power_track/rule.rb', line 7 def initialize params={} @value = params[:value] || params['value'] @tag = params[:tag] || params['tag'] end |
Instance Attribute Details
permalink #tag ⇒ Object
Returns the value of attribute tag.
5 6 7 |
# File 'lib/gnip_api/apis/power_track/rule.rb', line 5 def tag @tag end |
permalink #value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/gnip_api/apis/power_track/rule.rb', line 5 def value @value end |
Instance Method Details
permalink #attributes ⇒ Object
[View source]
16 17 18 19 20 21 |
# File 'lib/gnip_api/apis/power_track/rule.rb', line 16 def attributes attrs = {} attrs[:value] = @value if @value attrs[:tag] = @tag if @tag attrs end |
permalink #to_json ⇒ Object
[View source]
12 13 14 |
# File 'lib/gnip_api/apis/power_track/rule.rb', line 12 def to_json attributes.to_json end |
permalink #uid ⇒ Object
[View source]
23 24 25 26 27 |
# File 'lib/gnip_api/apis/power_track/rule.rb', line 23 def uid rule = @value rule += "tag:#{@tag}" if @tag Digest::SHA2.hexdigest(rule) end |