Class: SDM::ActivityGetResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

ActivityGetResponse returns a requested Activity.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(activity: nil, meta: nil, rate_limit: nil) ⇒ ActivityGetResponse

Returns a new instance of ActivityGetResponse.



1825
1826
1827
1828
1829
1830
1831
1832
1833
# File 'lib/models/porcelain.rb', line 1825

def initialize(
  activity: nil,
  meta: nil,
  rate_limit: nil
)
  @activity = activity == nil ? nil : activity
  @meta = meta == nil ? nil : meta
  @rate_limit = rate_limit == nil ? nil : rate_limit
end

Instance Attribute Details

#activityObject

The requested Activity.



1819
1820
1821
# File 'lib/models/porcelain.rb', line 1819

def activity
  @activity
end

#metaObject

Reserved for future use.



1821
1822
1823
# File 'lib/models/porcelain.rb', line 1821

def meta
  @meta
end

#rate_limitObject

Rate limit information.



1823
1824
1825
# File 'lib/models/porcelain.rb', line 1823

def rate_limit
  @rate_limit
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1835
1836
1837
1838
1839
1840
1841
# File 'lib/models/porcelain.rb', line 1835

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end