class Ryp::Resource

Attributes

raw[R]

Public Instance Methods

attributes() click to toggle source
# File lib/ryp/resource.rb, line 12
def attributes
  Hash.new.tap do |attributes|
    self.class.data_map.keys.each do |attribute|
      attributes[attribute] = send(attribute)
    end
  end
end
parse!(data) click to toggle source
# File lib/ryp/resource.rb, line 5
def parse!(data)
  self.class.data_map.each_pair do |attribute, key|
    instance_variable_set("@#{attribute}", data[key])
  end
  @raw = data
end
to_h() click to toggle source
# File lib/ryp/resource.rb, line 20
def to_h
  { url: url }.merge(attributes)
end