Class: Bitly::API::Bitlink::Deeplink
- Inherits:
-
Object
- Object
- Bitly::API::Bitlink::Deeplink
- Includes:
- Bitly::API::Base
- Defined in:
- lib/bitly/api/bitlink/deeplink.rb
Instance Attribute Summary
Attributes included from Bitly::API::Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data:) ⇒ Deeplink
constructor
A new instance of Deeplink.
- #to_json(opts = nil) ⇒ Object
Methods included from Bitly::API::Base
Constructor Details
#initialize(data:) ⇒ Deeplink
Returns a new instance of Deeplink.
15 16 17 |
# File 'lib/bitly/api/bitlink/deeplink.rb', line 15 def initialize(data:) assign_attributes(data) end |
Class Method Details
.attributes ⇒ Object
10 11 12 |
# File 'lib/bitly/api/bitlink/deeplink.rb', line 10 def self.attributes [:app_uri_path, :install_type, :install_url, :app_id] end |
Instance Method Details
#to_json(opts = nil) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/bitly/api/bitlink/deeplink.rb', line 19 def to_json(opts=nil) self.class.attributes.reduce({}) do |memo, key| value = instance_variable_get("@#{key}") memo[key] = value if value memo end.to_json(opts) end |