class Smartdown::Model::FrontMatter

Public Class Methods

new(attributes = {}) click to toggle source
# File lib/smartdown/model/front_matter.rb, line 4
def initialize(attributes = {})
  @attributes = attributes
end

Public Instance Methods

==(other) click to toggle source
# File lib/smartdown/model/front_matter.rb, line 32
def ==(other)
  other.is_a?(self.class) && self.to_hash == other.to_hash
end
fetch(name, *args) click to toggle source
# File lib/smartdown/model/front_matter.rb, line 24
def fetch(name, *args)
  @attributes.fetch(name.to_s, *args)
end
has_attribute?(name) click to toggle source
# File lib/smartdown/model/front_matter.rb, line 20
def has_attribute?(name)
  @attributes.has_key?(name.to_s)
end
method_missing(method_name, *args, &block) click to toggle source
Calls superclass method
# File lib/smartdown/model/front_matter.rb, line 8
def method_missing(method_name, *args, &block)
  if has_attribute?(method_name)
    fetch(method_name)
  else
    super
  end
end
respond_to_missing?(method_name, include_private = false) click to toggle source
# File lib/smartdown/model/front_matter.rb, line 16
def respond_to_missing?(method_name, include_private = false)
  has_attribute?(method_name)
end
to_hash() click to toggle source
# File lib/smartdown/model/front_matter.rb, line 28
def to_hash
  @attributes.dup
end