Class: API::WhatCounts::OneOffMessage
- Inherits:
-
Object
- Object
- API::WhatCounts::OneOffMessage
- Includes:
- Base
- Defined in:
- lib/whatcounts/base.rb
Overview
class Service
Instance Attribute Summary collapse
-
#api_service ⇒ Object
Returns the value of attribute api_service.
-
#data ⇒ Object
Returns the value of attribute data.
-
#format ⇒ Object
Returns the value of attribute format.
-
#list_id ⇒ Object
Returns the value of attribute list_id.
-
#pwd ⇒ Object
Returns the value of attribute pwd.
-
#realm ⇒ Object
Returns the value of attribute realm.
-
#template_id ⇒ Object
Returns the value of attribute template_id.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(message_data = {}) ⇒ OneOffMessage
constructor
A new instance of OneOffMessage.
- #send ⇒ Object
Constructor Details
#initialize(message_data = {}) ⇒ OneOffMessage
Returns a new instance of OneOffMessage.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/whatcounts/base.rb', line 79 def initialize( = {}) # check for required params [:pwd, :list_id, :realm, :format, :to, :template_id, :data].each do |key| raise ServiceError, "#{key.to_s} is required" unless .has_key?(key) end self.api_service = API::WhatCounts::Service.new self.pwd = [:pwd] self.list_id = [:list_id] self.realm = [:realm] self.format = [:format] self.to = [:to] self.template_id = [:template_id] self.data = build_data_args([:data]) end |
Instance Attribute Details
#api_service ⇒ Object
Returns the value of attribute api_service.
77 78 79 |
# File 'lib/whatcounts/base.rb', line 77 def api_service @api_service end |
#data ⇒ Object
Returns the value of attribute data.
76 77 78 |
# File 'lib/whatcounts/base.rb', line 76 def data @data end |
#format ⇒ Object
Returns the value of attribute format.
76 77 78 |
# File 'lib/whatcounts/base.rb', line 76 def format @format end |
#list_id ⇒ Object
Returns the value of attribute list_id.
76 77 78 |
# File 'lib/whatcounts/base.rb', line 76 def list_id @list_id end |
#pwd ⇒ Object
Returns the value of attribute pwd.
76 77 78 |
# File 'lib/whatcounts/base.rb', line 76 def pwd @pwd end |
#realm ⇒ Object
Returns the value of attribute realm.
76 77 78 |
# File 'lib/whatcounts/base.rb', line 76 def realm @realm end |
#template_id ⇒ Object
Returns the value of attribute template_id.
76 77 78 |
# File 'lib/whatcounts/base.rb', line 76 def template_id @template_id end |
#to ⇒ Object
Returns the value of attribute to.
76 77 78 |
# File 'lib/whatcounts/base.rb', line 76 def to @to end |
Instance Method Details
#send ⇒ Object
96 97 98 99 100 101 102 |
# File 'lib/whatcounts/base.rb', line 96 def send msg = self.api_service.(self) return msg.result rescue ServiceError return false end |