Module: PlayStoreInfo::Readers

Included in:
AppParser
Defined in:
lib/play_store_info/readers.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
# File 'lib/play_store_info/readers.rb', line 5

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#scrape_dataObject



9
10
11
12
13
# File 'lib/play_store_info/readers.rb', line 9

def scrape_data
  self.class.accessors.each do |field, _|
    instance_variable_set("@#{field}", send("read_#{field}"))
  end
end

#to_hashObject



19
20
21
# File 'lib/play_store_info/readers.rb', line 19

def to_hash
  Hash[self.class.accessors.map { |field| [field.to_sym, send(field)] }]
end

#to_json(*options) ⇒ Object



15
16
17
# File 'lib/play_store_info/readers.rb', line 15

def to_json(*options)
  to_hash.to_json(*options)
end